set resave and saveUninitialized in express session

This commit is contained in:
bill bittner 2017-10-18 10:46:06 -07:00
parent be18b060b5
commit b0d88263c7

View file

@ -40,7 +40,7 @@ app.use((req, res, next) => { // custom logging middleware to log all incoming
}); });
// initialize passport // initialize passport
app.use(session({ secret: 'cats' })); app.use(session({ secret: 'cats', resave: false, saveUninitialized: false }));
app.use(passport.initialize()); app.use(passport.initialize());
app.use(passport.session()); app.use(passport.session());
passport.serializeUser(serializeSpeechUser); // takes the user id from the db and serializes it passport.serializeUser(serializeSpeechUser); // takes the user id from the db and serializes it