How does Rails know when to delete an entry from the `session` table?

How does Rails know when to delete a record from a session table?

For example, if a user visits a website, a session record is created, but when the user closes the browser window, the server does not receive notifications, and how does Rails delete entries from the session table?

+5
source share
2 answers

You must submit your own session expiration implementation, as I understand it.

API , . created_on updated_at ( ), , , , updated_at.

, .

+3

:

ActiveRecord::SessionStore::Session.delete_all(["updated_at < ?", 12.hours.ago])

, .

, , .

+7

All Articles