I'm using express js 4 together with express-session
and set maxAge
to one hour. However if user continues accessing the website, the timeout should be extended otherwise the user will be logged out even he/she is still using it.
app.use(session({
secret: 'xxx',
name: 'sessionId',
resave: true,
saveUninitialized: true,
cookie: {
httpOnly: true,
maxAge: 1*60*60*1000
})
}))
It seems to be a common task but I can't find it anywhere. Thanks in advance.