diff --git a/index.js b/index.js index a84f60d5..2bdad4d0 100644 --- a/index.js +++ b/index.js @@ -244,10 +244,10 @@ function session(options){ } debug('destroyed'); - writeend(); + return _end.call(res, chunk, encoding); }); - return writetop(); + //return writetop(); } // no session to save @@ -266,13 +266,15 @@ function session(options){ } debug('saved'); - writeend(); + return _end.call(res, chunk, encoding); }); - return writetop(); + //return writetop(); + } else { + return _end.call(res, chunk, encoding); } - return _end.call(res, chunk, encoding); + //return _end.call(res, chunk, encoding); }; // generate the session @@ -489,4 +491,4 @@ function setcookie(res, name, val, secret, options) { : [prev, data]; res.setHeader('set-cookie', header) -} +} \ No newline at end of file diff --git a/package.json b/package.json index 7494c9f6..1f4c2502 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-session", - "version": "1.7.6", + "version": "1.8.2", "description": "Simple session middleware for Express", "author": "TJ Holowaychuk (http://tjholowaychuk.com)", "contributors": [