I\'m trying to get my Passport local strategy working.
I\'ve got this middleware set up:
passport.use(new LocalStrategy(function(username, password,
My problem was that i set cookie.secure to true even if data was not over https.
app.use(require('express-session')({
secret: process.env.sessionSecret,
cookie: {
maxAge: 1000 * 60 * 60 * 24 * 7 // 1 week
},
store: store,
resave: false,
saveUninitialized: false,
cookie: { secure: false } // Remember to set this
}));
Remember to set cookies to false if you're not using https
cookie: { secure: false } // Set to false
Also if you do believe you have https remember to trust the proxy
app.set('trust proxy', 1) // trust first proxy