Suppose we have a user variable $_SESSION['variable'] that may or may not be modified as the user access a page.
Suppose the same user has several browser windows open and somehow makes simultaneous requests to the server that result on changes to the session variable.
Questions:
How does the server "queue" these changes, since they are targeted at the same variable? Is there a potential for server error here?
Is there a way to "lock" the session variable for reading/writing in order to implement some kind of status check before changing its value?
EDIT ( thanks Unheilig for the cleanup)
Regarding the "queueing", I am interested in what happens if two requests arrive at the same time:
Change X to 1
Change X to 2
I know this doesn't seem a real world scenario, but it just came to my mind when designing something. It could become a problem if the system allows too many concurrent requests from the same user.
SESSIONand make sure you're receiving the correct information, and then process it accordingly.SESSION, and then checking the table before making changes or granting access, etc.