KBD

Keith Devens .com

Saturday, July 4, 2009 Flag waving
The three chief virtues of a programmer are: Laziness, Impatience and Hubris. – Larry Wall (Programming Perl)
← 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 2009
SunMonTueWedThuFriSat
 1234
567891011
12131415161718
19202122232425
262728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 3 posts

Recent comments XML

new⇒Wizard's First Rule

> while it is cheesy to some​extent, I actually found it to be​pretty enjoy...

Keith: Jul 3, 6:33pm

I hate Norton Antivirus

I bought Norton 2009 and it is not​installing on my computer!!!
It​seems l...

o'neil: Jun 30, 11:44am

Generated in about 0.193s.

(Used 8 db queries)