Permalink
Browse files

Make app.session.load automatically detect instance

  • Loading branch information...
1 parent 065dd01 commit 79d3cb349a44ec5e77541acbdee771771d6ea13b @mendezcode mendezcode committed Sep 7, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 middleware/session/session.js
@@ -191,7 +191,7 @@ Session.prototype.destroy = function(req, res, callback) {
*/
Session.prototype.load = function(req, res) {
- this.loadSession(req, res, req.next);
+ (this instanceof Session ? this : app.session).loadSession(req, res, req.next);
}
/**
@@ -204,6 +204,7 @@ Session.prototype.load = function(req, res) {
*/
Session.prototype.loadSession = function(req, res, callback) {
+
var fingerprint, sessHash, sessId, self;
if (req.__loadedSession === true) {

0 comments on commit 79d3cb3

Please sign in to comment.