Forum: Ruby on Rails Capture session end of life routine? def session_has_ended?

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.
Peter A. (Guest)
on 2008-12-13 19:55
Does RoR define a routine that runs _guaranteed_ when a session ends to
write out session info to database, etc.?

Pete
Jeremy W. (Guest)
on 2008-12-14 22:40
Peter A. wrote:
> Does RoR define a routine that runs _guaranteed_ when a session ends to
> write out session info to database, etc.?
>
> Pete

Not really, because sessions don't just end on their own. You can handle
the explicit logout case yourself pretty easily. If you want sessions to
expire (after a period of inactivity) you'll need to build something to
do that (like a rake task set up as a cron job) and you can persist
session state as part of that process.
This topic is locked and can not be replied to.