Revert "fix: #8142 invalid session warning if server-side session destroyed"

This reverts commit 526b3cd9ec.
v1.18.x
Julian Lam 5 years ago
parent f2907908c9
commit e327d1247e

@ -56,9 +56,8 @@ module.exports = function (middleware) {
}
// 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).
// req.session.flash is present if you visit register/login, so all logged-in users have it, but it is missing if your server-side session got destroyed.
if (!req.session.flash && !req.session.meta && !res.get('Set-Cookie')) {
// 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