fix(cookies): fix variable naming and extend to two days maxAge

This commit is contained in:
Benedikt Rötsch
2017-11-09 13:07:11 +01:00
parent e38137bfea
commit e38210445f

View File

@@ -1,4 +1,4 @@
const ONE_YEAR_IN_SECONDS = 86400
const TWO_DAYS_IN_SECONDS = 172800 // 60 * 60 * 24 * 2
module.exports.updateCookie = (response, cookieName, value) => {
response.cookie(cookieName, value, { maxAge: ONE_YEAR_IN_SECONDS, httpOnly: true })
response.cookie(cookieName, value, { maxAge: TWO_DAYS_IN_SECONDS, httpOnly: true })
}