We’ve been having a few niggles with session management, and I’ve just
released a plugin that deals with them.
In a nutshell there are problems when you have multiple concurrent
requests (several ajax calls, multiple browsers) from the same user
which lead to one action overwriting the changes made by another action.
If two actions are both trying to change the same key in the session
then there isn’t an awful lot you can do, however if the changes are to
different parts of the session there’s no reason why we can’t be a
little smarter about how we save the session.
You can find a more detailed description of the problem and our solution
at
http://about.82ask.com/2007/05/01/race-conditions-in-rails-sessions-and-how-to-fix-them/
If you’re too impatient to read the blog post then the plugin is at
http://svn1.hosted-projects.com/fcheung/smart_session_store/trunk
I’d be happy to here any comments or suggestions you have.
Fred