Forum: Ruby on Rails Do active_record_store sessions expire by default?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7b9848f7452ca6a1f681e68370577b1c?d=identicon&s=25 Michael Chow (nanostuff)
on 2007-04-18 00:34
If I'm not wrong, standard temp-file sessions expire when the active
window closes, does the same go for active_record_store sessions or must
they be emptied through specific instructions?

Thanks.
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-04-18 01:08
(Received via mailing list)
On Apr 18, 2007, at 12:34 AM, Peter Cho wrote:

> If I'm not wrong, standard temp-file sessions expire when the active
> window closes, does the same go for active_record_store sessions or
> must
> they be emptied through specific instructions?

Session expiration equals session _cookie_ expiration.

By default the cookie has no expiration date, which means it expires
when the user closes the browser. You can set a fixed expiration
window with

   ActionController::Base.session_options[:session_expires] = something

and dynamic expiration with this plugin

   http://agilewebdevelopment.com/plugins/dynamic_session_exp

The very database cleanup has to be done by hand. Just put a cron
task that deletes old records in the sessions table.

-- fxn
7b9848f7452ca6a1f681e68370577b1c?d=identicon&s=25 Michael Chow (nanostuff)
on 2007-04-18 03:39
Alright, thanks.
This topic is locked and can not be replied to.