Skip to content

Commit

Permalink
Fix race condition in logOut. Fixes jaredhanson#1004
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15m committed Sep 19, 2023
1 parent cfdbd4a commit 894fbf9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/sessionmanager.js
Expand Up @@ -86,8 +86,15 @@ SessionManager.prototype.logOut = function(req, options, cb) {
}
if (options.keepSessionInfo) {
merge(req.session, prevSession);
req.session.save(function(err) {
if (err) {
return cb(err);
}
cb();
});
} else {
cb();
}
cb();
});
});
}
Expand Down

0 comments on commit 894fbf9

Please sign in to comment.