Using active_record_store to store information related to my users' sessions and a great time with how simple it is, but also to find that it is so simple that I do not spend time to figure it out.
I recently discovered that when users exit my site, nothing in the Sessions table is deleted, so I quickly put together a fairly large session table.
I would like to do this: Delete the entry in the Sessions table when the user logs out and deletes the cookie on the user's computer. What do I need to add to my program to execute this command?
At the moment, all I'm doing is clearing the user ID from the session data, which is clearly not enough. I thought I could just delete the entry from the sessions by calling the destroy () method on the ActiveRecord object, but I don't have a session ID. (Maybe I just don't know how to get this?)
source share