I have a 4.x express app. I would like to store data in the session after user has successfully logged in. When I try to access this data in another request the data is always undefined. Here is my code :
app.use(expressSession({
secret: 'keyboard cat',
resave: false,
saveUninitialized: false,
cookie: {
secure : false,
httpOnly: true,
maxAge: 3600000
}
}));
After logIn I put the data into the session:
req.session.verficationCode = 123;
In each subsequent request the session data is lost ?