Skip to content
This repository

Fix for the connect sessions issue #207

Open
wants to merge 1 commit into from

2 participants

Pierre-Yves Gérardy James Keane
Pierre-Yves Gérardy
pygy commented August 18, 2012

Fixes #184

James Keane

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

Have you left code out of this merge request?

Pierre-Yves Gérardy
pygy commented August 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 18, 2012
Pierre-Yves Gérardy Fix the connect sessions. c51af4b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  lib/user.js
12  lib/user.js
@@ -56,11 +56,17 @@ exports.initialize = function (nowjs) {
56 56
     };
57 57
 
58 58
     // Populate session by parsing cookie
59  
-    var cookie = this.user.cookie[nowjs.options['cookieKey']];
60  
-    if (cookie) {
61  
-      this.user.session = nowjs.sessions[unescape(cookie)];
  59
+    var sid = decodeURIComponent(this.user.cookie['connect.sid']);
  60
+    if (sid) {
  61
+      var self = this;
  62
+      nowjs.sessionStore.get(sid, function (err, session) {
  63
+        self.user.session = session;
  64
+        return;
  65
+      });
62 66
     }
63 67
 
  68
+
  69
+
64 70
     // set to true upon first replaceVar and emit connect event
65 71
     /**
66 72
      * @private
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.