EN
Node.js - how to set session expiration time in Express.js cookie
1
answers
0
points
How to set the session to last for 48 hours in Express.js cookie?
1 answer
3
points
In cookie, you need to specify maxAge with time in milliseconds.
Practical example:
app.use(
session({
// some properties here ...
cookie: {
maxAge: 48 * 60 * 60 * 1000 // 48 hours in milliseconds
},
})
);
See also:
0 comments
Add comment