Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #68 from brianloveswords/no-event-dependency
Browse files Browse the repository at this point in the history
Remove dependency on express/connect emitted event
  • Loading branch information
seanmonstar committed Nov 19, 2013
2 parents 7654522 + 8700d6a commit 1d69ef7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/client-sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ var cookieSession = function(opts) {
if (req[propertyName]) {
return next(); //self aware
}

var cookies = new Cookies(req, res);
var raw_session;
try {
Expand All @@ -422,9 +422,11 @@ var cookieSession = function(opts) {

req[propertyName] = raw_session.monitor();

res.on('header', function() {
var writeHead = res.writeHead;
res.writeHead = function () {
raw_session.updateCookie();
});
return writeHead.apply(res, arguments);
}

next();
};
Expand Down

0 comments on commit 1d69ef7

Please sign in to comment.