'How long is session stored in express-session on server?

I have used ExpressJS with express-session for Session Management. According to its NPM page, we can add a maxAge and cookies.expires. But, both of these manage the expiration date of the cookies. But what about the server side? For how long does the session store keep the sessions? What if we don't set the maxAge and cookies.expires and the user closes the browser abruptly? Will the session data on server side be stored permanently without removal?



Solution 1:[1]

No it won't. The session data is stored in the memory(RAM) if you haven't specified a separate store(e.g. redis,mongodb, etc.)

When you shut down the server all the info will be removed

Solution 2:[2]

The stuff inside the session will live until the cookie expires

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 michaelgrigoryan25
Solution 2 mercury