4 ms·
You can configure cookie-based sessions to be persistent. http://api.rubyonrails.org/classes/ActionController/Session/CookieStore.html http://api.rubyonrails.o
by epochwolf 16y ago
You can configure cookie-based sessions to be persistent.
http://api.rubyonrails.org/classes/ActionController/Session/CookieStore.html http://api.rubyonrails.org/classes/ActionController/Session/...
For rails 3 in config/initializers/session_store.rb
Rails.application.config.session_store :cookie_store, :key => '_session', :expire_after => 2.weeks
- mhartl 16y agoI'll take a look at this. I know that Rails 3 has a new way of doing things, but every Rails 2.3.x authentication system I've seen uses some kind of remember token. Maybe we're all just doing it wrong. :-) Update: I don't see any way to persist the session variable (where do the options go in session[:user_id] = user.id?), and I'm a little nervous about doing so, since the whole point of a session is that it doesn't persist. I'll stick with cookies for now. The Rails 3 version of the tutorial will probably use "permanent" cookies as per this blog post: http://m.onkey.org/2010/2/5/signed-and-permanent-cookies-in-rails-3 http://m.onkey.org/2010/2/5/signed-and-permanent-cookies-in-...
- epochwolf 16y agoWell I did roll my own signed cookies using http://gist.github.com/416030 http://gist.github.com/416030 Just a note, that cookie is used by created by rails and used dokuwiki using a custom authenication class I made. (dokuwiki verifies the signing)