KBD

Keith Devens .com

Friday, July 25, 2008 Flag waving
That which yields, is not always weak. – Jacqueline Carey (Kushiel's Dart)
← New Scientist: Mathematical proofs getting harder to verifySkatter Tech » How To Block Fasterfox Requests →

Daily link icon Saturday, February 25, 2006

Ajaxian » Troubles with Asynchronous Ajax Requests and PHP Sessions

Ajaxian » Troubles with Asynchronous Ajax Requests and PHP Sessions. Links to Marc Wandschneider's post explaining why you need to think about about possible race conditions with session data when using Ajax. Via Keith Gaughan, who posts some good comments on the Ajaxian thread about causes and possible solutions.

In short, server-side technologies like PHP don't let you lock access to your session across requests. So, you can A. try to do some complicated locking of your own on the server. B. store the critical session data in a MySQL RAM table (or some other equivalent) which AFAIK will handle the locking for you (of course, you're still not safe in this case unless you're careful). C. give the client knowledge of what changes the session state on a server that could lead to a race condition, and make sure those requests are serialized (i.e. get a response from the server before sending the next request).

Update: Harry Fuecks has a follow-up article on this.

← New Scientist: Mathematical proofs getting harder to verifySkatter Tech » How To Block Fasterfox Requests →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive

Generated in about 0.175s.

(Used 8 db queries)

mobile phone