How is the express req.session object persisted?
问题 I'm very new to learning Node and Express, and I'm still trying to wrap my head around the code flow with express. Suppose we have code that looks like this in a session.js: app.post('/session', notLoggedIn, function(req, res) { User.findOne({ username: req.body.username, password: req.body.password }, function (err, user) { if (err) { return next(err); } if (user) { req.session.user = user; res.redirect('/users'); } else { res.redirect('/session/new'); } }); }); Assuming the User is a