Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from ministryofjustice/ag--cookie-max-age
Browse files Browse the repository at this point in the history
Session expires after 8 hours (by default)
  • Loading branch information
xoen authored Feb 27, 2018
2 parents 4642b50 + 017524d commit 1884f1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# analytics-platform-rstudio-auth-proxy
RStudio auth proxy


### Environment variables

- `COOKIE_MAXAGE`, maximum age of session cookies in seconds.
Defaults to `3600` seconds (1 hours).
See [`Set-Cookie: MaxAge` documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)
4 changes: 4 additions & 0 deletions app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ config.session = {
resave: true,
saveUninitialized: true,
secret: process.env.COOKIE_SECRET || 'shh-its-a-secret',
cookie: {
// `COOKIE_MAXAGE` in seconds (defaults to 1 hour = 3,600,000 ms)
maxAge: (Number.parseInt(process.env.COOKIE_MAXAGE, 10) || 3600) * 1000,
},
};

config.auth0 = {
Expand Down

0 comments on commit 1884f1e

Please sign in to comment.