Expensive time of day

I can not understand why the maxAge settings from the configurator do not work:

app.use(cookieSession({ name: 'sessiondata', keys: ['key1', 'key2'], cookie: { //secure: true, //httpOnly: true, //domain: 'example.com', //path: 'foo/bar', maxAge: 1 } }) ); 

With this indication, maxAge manually works:

 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'); }); 
  • Because it is expected that the maxAge parameter is a number, and you assign it a string? ( maxAge: a number representing the milliseconds from Date.now() for expiry ) - Yaant
  • I tried it anyway :( And without quotes and p. - enhaster

1 answer 1

This has no effect on the res.cookie command.

This module is not related to the res.cookie command, therefore the settings from this module are not related to this command.