const session = require('express-session')

const redisStore = require('../../config/redis-store')
const config = require('../../config')

const sessionStore = session({
  store: redisStore,
  proxy: config.isProd,
  cookie: {
    secure: config.isProd,
    maxAge: config.session.ttl,
  },
  rolling: true,
  secret: config.session.secret,
  resave: true,
  saveUninitialized: false,
  unset: 'destroy',
})

module.exports = sessionStore

const session = require('express-session')

const redisStore = require('../../config/redis-store')
const config = require('../../config')

const sessionStore = session({
  store: redisStore,
  proxy: config.isProd,
  cookie: {
    secure: config.isProd,
    maxAge: config.session.ttl,
  },
  rolling: true,
  secret: config.session.secret,
  resave: true,
  saveUninitialized: false,
  unset: 'destroy',
  key: 'datahub.sid',
})

module.exports = sessionStore

Add datahub specific session key
Add datahub specific session key

This changes brings back in the datahub.sid key for our session, I
previously removed this and have noticed that it is needed back as we
clear the cookie via "datahub.sid".
This changes the default "connect.sid" to "datahub.sid"
