Suppose you have a controller with 2 actions that look like this
def long
session[:foo] = "bar"
sleep 15
render :nothing => true
end
def short
session[:short] = 1
render :nothing => true
end
def status
render :text => "session[:short] = #{session[:short]}"
end
This app is using the default Pstore sessions
I ran this app on a bunch of mongrels. In one browser window I kicked
off the long action, meanwhile in the second I ran the short action, and
then the status action to verify that the session did indeed contain the
value 1 for the key :short.
However once the long running action completes in then clobbers the hash
with its view of the world. session[:short] goes back to being empty.
Looking at the source it is clear why this happens: the first time the
session is accessed it is loaded from disk, and it is written back when
the action completes: it doesn''t care if the session has changed in
between.
Obviously we don''t store anything vital in the session, but I was
wondering how other people cope with this.
Thanks,
Fred
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---