Ben Knight
2007-Jul-11 17:07 UTC
Session Expiration Problem: How to keep a user logged in for
How do I keep the Rails session from expiring when the browser exits? I would ideally like the user to be logged for a few days (e.g. 2 weeks). Do I use the Rails "session" or "cookies"? Also, my understanding is that session[:session_expires] doesn''t work. Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2007-Jul-11 17:54 UTC
Re: Session Expiration Problem: How to keep a user logged in for
On 11 Jul 2007, at 19:07, Ben Knight wrote:> How do I keep the Rails session from expiring when the browser > exits? I > would ideally like the user to be logged for a few days (e.g. 2 > weeks). > > Do I use the Rails "session" or "cookies"? Also, my understanding is > that session[:session_expires] doesn''t work.You need to use a cookie and use that to log the user in automatically. You can then set the cookie to expire after 2 days, 2 weeks, 2 months, ... It''s part of acts as authenticated and restful authentication, but here''s a page describing the way to do it yourself: http://technoweenie.stikipad.com/plugins/show/Remember+Me Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---