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.
4c1eaa228c74856babe8a895a093a500?d=identicon&s=25 Peter Alvin (remoteportal)
on 2008-12-13 18:55
Does RoR define a routine that runs _guaranteed_ when a session ends to
write out session info to database, etc.?

Pete
5170ca260dbd2cdfd5a887a4dba7636f?d=identicon&s=25 Jeremy Weiskotten (jeremy_weiskotten)
on 2008-12-14 21:40
Peter Alvin 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.