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()
- What is
cookies
there? - Does it mean we have to use
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']
}));