Answer the question
In order to leave comments, you need to log in
Expressjs cookie-session (maxAge settings not working)?
Dear time of day,
I can’t understand why the maxAge settings from the configurator do not work:
app.use(cookieSession({
name: 'sessiondata',
keys: ['key1', 'key2'],
cookie: {
maxAge: 1 // не устанавливается по умолчанию
}
})
);
app.get('/login', function(req, res, next) {
res.cookie('id', 'lol'); //не работает
res.cookie('id2', '2222222', { maxAge: 1222});//работает
res.send(req.cookies.id+req.cookies.id2);
//res.render('login');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question