2

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']
}));
Alvaro
  • 40,778
  • 30
  • 164
  • 336

1 Answers1

1

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.

Community
  • 1
  • 1
Alvaro
  • 40,778
  • 30
  • 164
  • 336