Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the connect sessions.

  • Loading branch information...
commit c51af4b391a8b8ef46d970761c98ab127610b9b7 1 parent 957e7ac
@pygy authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/user.js
View
12 lib/user.js
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.