My understanding is that, in apps using express on top of node, the session object can be accessed through req.session
, which can have any number of key/value pairs set on it.
What's the advantage of using this method over storing key/value pairs on the global sessionStorage object in the DOM?
There are several advantages:
express.session
stays on your server, so you can store things there that won't be accessible to the client