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.

On 11 Jul 2007, at 19:07, Ben K. 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