Closed BadPistol97 closed 1 year ago
I was wondering that the other day. If I read the source code correctly, expired session records are deleted automatically every fifteen minutes, so you do not need to delete them yourself.
In your application logic, you can delete the session of the active user when they logout. The express-session module adds the session ID to the request object of express as req.session.id
. So in your logout route, you could delete the session row from your database using this session ID.
Closing this as it's likely been solved.
How to delete the record in the table when user log out? if I am supposed to do so.