Reputation: 41595
As express-session is not ready to work on production environments unless you change the module to something like redisStorage
, I decided to go for cookie-session.
The documentation doesn't seem to be very clear to me. It says
Other options are passed to cookies.get() and cookies.set()
cookies
there? set
to set the options we want?I was trying to use cookieSession as express-session, but it seems that's not the way it works:
var cookieSession = require('cookie-session');
app.use(cookieSession({
maxAge: 20*60*1000, //20 mins
httpOnly: true,
secure: true,
secureProxy: true,
keys: ['key1', 'key2']
}));
Upvotes: 2
Views: 98
Reputation: 41595
I was in fact doing it in the right way. But because the documentation can be confusing I was not certain.
This answer helped me to understand what documentation really means.
Upvotes: 1