Greg Hauptmann
2006-Nov-14 10:55 UTC
should rails sessions remain after the browser has closed???
Hi, Just double checking - should rails sessions remain after the browser has closed??? I''m running active record sessions (i.e. persisted to database via active record), however I note that closing the browser and re-opening builds up multiple sessions in the database table. Is this expected behavior for a session? Tks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2006-Nov-14 14:32 UTC
Re: should rails sessions remain after the browser has close
Yes - your webserver doesn''t (and realistically cannot) know if the user has closed their browser. The cookie which enabled them to get at that session however has gone away, and so you get a new session, as expected. This does mean that session build up over time, most people have some form of cron jobs that clears out their old sessions. 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 -~----------~----~----~----~------~----~------~--~---
Zack Chandler
2006-Nov-14 16:19 UTC
Re: should rails sessions remain after the browser has closed???
On 11/14/06, Greg Hauptmann <greg.hauptmann.ruby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Just double checking - should rails sessions remain after the browser has > closed??? > > I''m running active record sessions (i.e. persisted to database via active > record), however I note that closing the browser and re-opening builds up > multiple sessions in the database table. Is this expected behavior for a > session? > > Tks > > > >Greg, This is normal behavior. You need to cleanup these sessions yourself which can easily be done with rake during development (rake db:sessions:clear) or a cron job in production (http://depixelate.com/2006/11/10/quick-tip-flexible-session-sweeping). Hope this helps. -- Zack Chandler http://depixelate.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 -~----------~----~----~----~------~----~------~--~---