Skip to content

Commit

Permalink
Fix the connect sessions.
Browse files Browse the repository at this point in the history
  • Loading branch information
pygy committed Aug 18, 2012
1 parent 957e7ac commit c51af4b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/user.js
Expand Up @@ -56,11 +56,17 @@ exports.initialize = function (nowjs) {
};

// Populate session by parsing cookie
var cookie = this.user.cookie[nowjs.options['cookieKey']];
if (cookie) {
this.user.session = nowjs.sessions[unescape(cookie)];
var sid = decodeURIComponent(this.user.cookie['connect.sid']);
if (sid) {
var self = this;
nowjs.sessionStore.get(sid, function (err, session) {
self.user.session = session;
return;
});
}



// set to true upon first replaceVar and emit connect event
/**
* @private
Expand Down

0 comments on commit c51af4b

Please sign in to comment.