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

Commit

Permalink
Session expires after 1 hour (by default)
Browse files Browse the repository at this point in the history
Can be configured by setting the `COOKIE_MAXAGE` environment variable to
the number of seconds after which cookie session will expire.
  • Loading branch information
xoen committed Feb 27, 2018
1 parent 4642b50 commit 017524d
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 017524d

Please sign in to comment.