fix: tweak to session validation in addHeaders

v1.18.x
Julian Lam 5 years ago
parent 630f5d5b85
commit eddbd86837

@ -55,7 +55,8 @@ module.exports = function (middleware) {
headers['X-Upstream-Hostname'] = os.hostname();
}
// Validate session
// Ensure that the session is valid. This block guards against edge-cases where the server-side session has
// been deleted (but client-side cookie still exists)
if (req.uid > 0 && !req.session.meta && !res.get('Set-Cookie')) {
res.clearCookie(nconf.get('sessionKey'), meta.configs.cookie.get());
}

Loading…
Cancel
Save