The "Basic Usage" example code is missing a next() function call, breaking the middleware chain:
app.use(function(req, res, next) {if (req.mySession.seenyou) {res.setHeader('X-Seen-You', 'true');} else {// setting a property will automatically cause a Set-Cookie response// to be sentreq.mySession.seenyou = true;res.setHeader('X-Seen-You', 'false');}});
The "Basic Usage" example code is missing a
next()
function call, breaking the middleware chain:app.use(function(req, res, next) {
if (req.mySession.seenyou) {
res.setHeader('X-Seen-You', 'true');
} else {
// setting a property will automatically cause a Set-Cookie response
// to be sent
req.mySession.seenyou = true;
res.setHeader('X-Seen-You', 'false');
}
});