Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for the connect sessions issue #207

Closed
wants to merge 1 commit into from

2 participants

@pygy

Fixes #184

@jameskeane

When I try to merge this, nowjs.sessionStore is not defined.

Have you left code out of this merge request?

@pygy
@pygy pygy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 18, 2012
  1. @pygy

    Fix the connect sessions.

    pygy authored
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.