mozilla / node-client-sessions

secure sessions stored in cookies
Mozilla Public License 2.0
759 stars 104 forks source link

Basic Usage Example Missing "next()" #135

Open terrymorse58 opened 6 years ago

terrymorse58 commented 6 years ago

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'); } });