Add session max age
This commit is contained in:
parent
d6b4a0f32d
commit
b7db7e0ec8
2 changed files with 5 additions and 1 deletions
|
@ -5,5 +5,6 @@ module.exports = {
|
|||
port: process.env.PORT || 3000,
|
||||
proxyServer: process.env.PROXY_SERVER || undefined,
|
||||
secret: process.env.SECRET || require('./secret'),
|
||||
sessionMaxAge: Number(process.env.SESSION_MAX_AGE) || 1000 * 60 * 60 * 24 * 7,
|
||||
siteTitle: process.env.SITE_TITLE || 'Christmas Community'
|
||||
};
|
||||
|
|
5
index.js
5
index.js
|
@ -50,7 +50,10 @@ app.use(session({
|
|||
secret: config.secret,
|
||||
resave: false,
|
||||
saveUninitialized: true,
|
||||
store: new LevelStore(sessionDb)
|
||||
store: new LevelStore(sessionDb),
|
||||
cookie: {
|
||||
maxAge: config.sessionMaxAge
|
||||
}
|
||||
}));
|
||||
app.use(flash());
|
||||
app.use(passport.initialize());
|
||||
|
|
Loading…
Reference in a new issue