Under what conditions can the session be corrupted? By default the app engine uses MemcacheSessionHandler to save sessions and google even warns that it can be corrupted. From what I understand it can be corrupted if multiple requests are handled at the same time? So if I make 3 rest calls can these overwrite the session for each other?
The specific problem I'm having is with a CSRF check for Facebook Account-Kit. The CSRF tokens are saved in the sessions but the order doesn't seem to matter or they are corrupted somehow. Example:
- Generate CSRF 'ABC' and save in session by navigating to the site.
- Generate CSRF 'DEF' and save in session by clicking a link that takes you to another page to log in.
- Click login and send CSRF 'DEF' but the one in the session is 'ABC' so the call will fail.
How can that happen? There are even many seconds(~20) in between each call. And I've checked that the session id is the same for all requests. To make it worse this doesn't happen every time either.