Inactive session data in session
table in DB
#91
Replies: 2 comments 2 replies
-
So, overall, I wouldn't be too concerned about session data build-up. The storage size is almost nothing, even at 100k records. However, it is still good to clear the cobwebs from time to time. I would look into an NPM CRON job handler (I'm pretty sure there was, maybe still is a Sails Hook). Then, once a day, clear out sessions that haven't been updated in the past 90 days (or however long); making sure to use the slowest time to do so. |
Beta Was this translation helpful? Give feedback.
-
Something recently came to mind, that I thought I built in, but hadn't... I used to make it standard practice to have an I'm likely going to add this in to my next update. |
Beta Was this translation helpful? Give feedback.
-
Hi @neonexus,
Usually the users log on to the web app, their sessions are stored in the
session
table in DB. When they logout, the data are deleted accordingly. Operation is fine.But when the users doesn't explicitly logout and comeback after a session timeout or any abrupt ending of the session, I believe the corresponding data doesn't get removed and is retained in DB. Mostly users don't explicitly logout and such inactive session data keeps accumulating.
Would you recommend any approach to effectively remedy this?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions