I use this for express app.js;
app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }}))
but, confirm me:
express-session deprecated undefined resave option; provide resave option app.js:49:9
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option app.js:49:9
and run confirm:
_http_outgoing.js:331
throw new Error('Can\'t set headers after they are sent.');
why?
@timepast for the "deprecated" messages, you can find more on the readme, but if you don't want to make an informed decision, the easiest way to silence those messages is to change your app.use to the following:
app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }, resave: true, saveUninitialized: true }))
As for your displayed error, the messages are in no way related. We cannot assist you with that error unless you are able to post code we can run that reproduces the error, unfortunately.
Most helpful comment
@timepast for the "deprecated" messages, you can find more on the readme, but if you don't want to make an informed decision, the easiest way to silence those messages is to change your
app.useto the following:As for your displayed error, the messages are in no way related. We cannot assist you with that error unless you are able to post code we can run that reproduces the error, unfortunately.