Is it ever sensible to attempt to persist data across a session using request.env? Say something like: request.env[''user_name''] = ''bob'' I''m discussing this with the maintainer of a commercial gem (where it doesn''t seem to work). My natural instinct would be to do this instead (indeed, I patched the gem): session[:user_name] = ''bob'' I''m guessing that his use of request.env is derived from experience in another language (PHP?) and I just wanted to check that it wasn''t some obscure, but reasonable, railsian way of doing things (that wasn''t working on any of my three environments) before I went back to him. Cheers, Todd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 3 Feb 2009, at 18:47, tatyree wrote:> > Is it ever sensible to attempt to persist data across a session using > request.env? Say something like: > > request.env[''user_name''] = ''bob'' > > I''m discussing this with the maintainer of a commercial gem (where it > doesn''t seem to work). >Nope not a chance in hell. The request environment last for the duration of the request.> My natural instinct would be to do this instead (indeed, I patched the > gem): > > session[:user_name] = ''bob'' >That''s what I would> I''m guessing that his use of request.env is derived from experience in > another language (PHP?) and I just wanted to check that it wasn''t some > obscure, but reasonable, railsian way of doing things (that wasn''t > working on any of my three environments) before I went back to him. > > Cheers, > Todd > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank Frederick,> Nope not a chance in hell. The request environment last for the > duration of the request.That''s exactly what I though. Cheers, Todd --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Across a session, or a request/response loop? Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 04/02/2009, at 5:47 AM, tatyree <tatyree-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Is it ever sensible to attempt to persist data across a session using > request.env? Say something like: > > request.env[''user_name''] = ''bob'' > > I''m discussing this with the maintainer of a commercial gem (where it > doesn''t seem to work). > > My natural instinct would be to do this instead (indeed, I patched the > gem): > > session[:user_name] = ''bob'' > > I''m guessing that his use of request.env is derived from experience in > another language (PHP?) and I just wanted to check that it wasn''t some > obscure, but reasonable, railsian way of doing things (that wasn''t > working on any of my three environments) before I went back to him. > > Cheers, > Todd > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---