UNPKG

@dwp/govuk-casa

Version:

Framework for creating basic GOVUK Collect-And-Submit-Applications

26 lines (23 loc) 583 B
/** * Use session middleware. * This will hydrate the HTTP request with a `session` object containing the * session data. */ const expressSession = require('express-session'); const genid = require('./genid.js'); module.exports = (logger, config) => expressSession({ store: config.store, secret: config.secret, resave: false, saveUninitialized: false, cookie: { secure: config.secure, httpOnly: true, path: config.cookiePath, maxAge: null, sameSite: config.cookieSameSite, }, name: config.name, unset: 'destroy', genid: genid(logger), });