Skip to content
Snippets Groups Projects
Commit 3d2f1ac3 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

another patch to cookie-sessions. don't bring the server down when a bad...

another patch to cookie-sessions.  don't bring the server down when a bad cookie is detected.  just ignore it
parent 79d3119d
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,14 @@ var exports = module.exports = function(settings){
}
// Read session data from a request and store it in req.session
req.session = exports.readSession(
s.session_key, s.secret, s.timeout, req);
var bad_cookie = false;
try {
req.session = exports.readSession(
s.session_key, s.secret, s.timeout, req);
} catch(e) {
console.log("bad cookie: " + e);
bad_cookie = true;
}
// proxy writeHead to add cookie to response
var _writeHead = res.writeHead;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment