-
-
Notifications
You must be signed in to change notification settings - Fork 996
Open
Labels
Description
on extension to #452
1)Want to manually extend session - if user wants to
2)have set rolling to false
3)before expiration updated maxage
extendSession: (req, res) => {
if (!req.session) {
return res.sendStatus(401); // Unauthorized
}
const sessionExtension = 1000 * 60 * 3;
logger.debug('Before extension:', req.session.cookie);
req.session.cookie.maxAge = sessionExtension;
req.session.touch();
req.session.save(err => {
if (err) {
console.log("error in extension", err);
return res.status(500).send('Error extending session.');
}
const newExpiry = req.session.cookie.expires ? req.session.cookie.expires.getTime() : Date.now() + sessionExtension;
logger.debug('After extension:', req.session.cookie);
res.json({ message: 'Session extended by 24 hours.', newExpiry });
});
},
Still not able to get set-cookie response in the header