views:

456

answers:

2

I'd like to add something like the "remember me" option into a Rails application and I need to create a persistent session that doesn't expire when the user closes his browser. The only solution I found right now is to use a plugin: http://blog.codahale.com/2006/04/08/dynamic-session-expiration-times-with-rails/

Are there any other (better) solutions?

+1  A: 

Use cookies and set the expiration to a date very far into the future.

TheTXI
+1  A: 

Take a look at how technoweenie's restful authentication does it.

Particularly line 122 of the generator which allows login from a cookie.

wombleton