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']
}));

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.