Capture session end of life routine? def session_has_ended?


#1

Does RoR define a routine that runs guaranteed when a session ends to
write out session info to database, etc.?

Pete


#2

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.