Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix for the connect sessions issue #207

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+9 −3
Split
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