Read cookie session length from settings file

This commit is contained in:
James Allen 2015-04-14 13:04:29 +01:00
parent 5f6bdaf700
commit 8b4ccae60a
2 changed files with 5 additions and 5 deletions

View file

@ -34,9 +34,6 @@ else
app = express()
cookieKey = Settings.cookieName
cookieSessionLength = 5 * oneDayInMilliseconds
csrf = express.csrf()
ignoreCsrfRoutes = []
app.ignoreCsrf = (method, route) ->
@ -59,10 +56,10 @@ app.configure () ->
proxy: Settings.behindProxy
cookie:
domain: Settings.cookieDomain
maxAge: cookieSessionLength
maxAge: Settings.cookieSessionLength
secure: Settings.secureCookie
store: sessionStore
key: cookieKey
key: Settings.cookieName
# Measure expiry from last request, not last login
app.use (req, res, next) ->

View file

@ -229,6 +229,9 @@ module.exports =
# then set this to true to allow it to correctly detect the forwarded IP
# address and http/https protocol information.
behindProxy: false
# Cookie max age (in milliseconds). Set to false for a browser session.
cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
# Internal configs
# ----------------