Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of storing the session in a session store like Mongo-Store?

I understand how the process and request flows in passport but what i dont understand is why are we even using a session store when the cookie just expires after the max age but the session in the session store is always there storing the session id even after the cookie is expired!?

like image 933
gaurav_rajput Avatar asked Dec 07 '25 07:12

gaurav_rajput


1 Answers

Well, I use it for analytics. Like how many sessions we had today. Or yesterday. Or for the year.

Also if you don’t use something like redis of mongo, all your memory will get eaten up. Express-session isn’t built for production environments.

https://github.com/expressjs/session/issues/556

like image 68
alec wilson Avatar answered Dec 08 '25 21:12

alec wilson