Tuesday, December 17, 2013

[Rails] Re: Menu selections too fast for Heroku?



On Monday, December 16, 2013 6:38:12 PM UTC, Ruby-Forum.com User wrote:
Thanks Jason,

Is this common?


Race conditions on the rails session do happen, and can't really be fixed with the default rails session store. With this the entirety of the session is in the cookie, and your requests can look look like this

request 1 sent (initial session)
request 2 sent (initial session)
response 1 received (sets session to intial + value set by processing of request 1)
response 2 received (sets session to intial + value set by processing of request 2)

so the values set by response 1 are completely obliterated. In development multiple requests are not processed in parallel so this can't happen.
I think post people don't stick stuff in the session that is too important.

I once wrote a session store (base on the active record store) ( https://github.com/fcheung/smart_session_store ) that mitigates this. It does mean that sessions are stored in the database rather than in the cookie

Fred
 
Dave

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/94fd979d-f6a2-45e6-8e23-70488b0e9c51%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate