You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find any feature to limit the length of a session or to clean up old sessions from the database (mongodb in my case). Is there some recommended way to handle this?
The text was updated successfully, but these errors were encountered:
For session length limit, there's an option called expireAfterSeconds when you instantiate the session. It's not documented yet. If the session isn't valid when access is attempted after that expiry, it will be deleted.
app.use(Session.initMiddleware(store,{expireAfterSeconds: 900}))// session will expire after 15 minutes of inactivity
If you want to get rid of stale sessions, there's a property stored with the other session data called _accessed that is updated whenever the session is read from or written to. You could come up with a cron job script to look for any sessions that have _accessed values that are older than a certain threshold. Maybe someday we will integrate this more tightly into the library.
I can't find any feature to limit the length of a session or to clean up old sessions from the database (mongodb in my case). Is there some recommended way to handle this?
The text was updated successfully, but these errors were encountered: