On Sat, Jan 30, 2010 at 5:08 AM, Frederick Cheung
<frederick.che...@gmail.com> wrote:
>
>
> On Jan 30, 7:25 am, Ralph Shnelvar <li...@ruby-forum.com> wrote:
>> I'm trying to wrap my head around what information is session specific
>> and what isn't.
>>
>> If I do
>>   User::x = 1
>> will User::x == 1 for all sessions on the same machine?
>>
>> I think it is the same on the same, but I'd like confirmation.
>
> It will be the same for all requests handled by that particular
> instances. If you have a pool of passenger/mongrel/thin/unicorn/etc
> instances then each one would have a different value.

And different requests for the same session might well run on
different instances, so see different values.

Same problem with the suggestion to use thread local variables made by
a responder to this thread.

I'm pretty sure that the only way to deal with values which have to be
seen between requests is to either put them in some persistent storage
on the server (e.g. the DB, SQL or noSQL), or in the session and let
the browser give it back to you.

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to