express-session-passport-cleanup

Clean up after passport when using it with express-session

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
express-session-passport-cleanup
801.0.39 years ago9 years agoMinified + gzip package size for express-session-passport-cleanup in KB

Readme

Don't Create Anymore Empty Sessions
There is this silly issue where passport modifies the session causing express-session to create a bunch of extra sessions. This module fixes that by using a method similar to that recommended by @Joris-van-der-Wel here. This module instead overrides the end method on res, becuase either things have changed in express-session or that solution never worked correctly.

Install

$ npm install --save express-session-passport-cleanup

Usage

var expressSessionPassportCleanup = require('express-session-passport-cleanup');

app.use(session({/* ... */}));
// Include it right after the express session middleware
app.use(expressSessionPassportCleanup);
app.use(passport.initialize());
app.use(passport.session());