So here is my test setup:
session_start();
if(!isset($_SESSION['bahhhh']))
$_SESSION['bahhhh'] = 0;
$_SESSION['bahhhh']++;
sleep(5);
die('a'.$_SESSION['bahhhh']);
I expect that every time I click on the page, it returns a different number.
But if I use several tabs and update them every 5 seconds after the first, they all return the same number. (This is not client-side caching, as the 5 second delay is still obvious.)
Why is he doing this and how to fix it?
It seems to have the same weird caching problem with files and database data, and this prevents me from creating a working mutex to prevent the same code from being run more than once at a time.
Here is another simpler example:
echo microtime();
sleep(10);
Run it 3 times, every 2 seconds, and all three return the same microsecond. WTF?