Permalink
Browse files

Fix the connect sessions.

  • Loading branch information...
pygy committed Aug 18, 2012
1 parent 957e7ac commit c51af4b391a8b8ef46d970761c98ab127610b9b7
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/user.js
View
@@ -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

0 comments on commit c51af4b

Please sign in to comment.