Reputation: 79
Let's say we have two pages A, and B that both use/set the same session variable. These pages are called via AJAX so it's possible that they run simultaneously for the same user. My question is, if page A changes the session variable, does page B observe the new value right after the change?
Upvotes: 0
Views: 63
Reputation: 67147
The first request that gets handled by PHP will lock the session file, and any concurrent request for the same session will have to wait for the first request to release the lock.
So, yes, AJAX calls on the second page will get the updated data, if they are initiated after the first request.
Upvotes: 0