title: Connect signed cookie parsing falsy
body: <p>I'm having problems while trying to parse back signed cookies in express/connect application.</p>
  
  <pre><code>io.set('authorization', function (handshakeData, callback) {
      if(handshakeData.headers.cookie) {
          var signedCookies = cookie.parse(decodeURIComponent(handshakeData.headers.cookie));
          handshakeData.cookie = connect.utils.parseSignedCookies(signedCookies, secret);
      } else {
          return accept('No cookie transmitted', false);
      }
      callback(null, true); // error first callback style 
  });
  </code></pre>
  
  <p>What happens is call to <code>connect.utils.parseSignedCookies</code> returns empty object. I looked into source for parse function and found out that it calls unsign method which gets a substring of encoded value and then tries to sign it again with the same secret and compare the results to verify that its the same value encoded and for some reasons it fails and values does not match. I don't know what I'm doing wrong, why those values differs and why I'm unable to get correct session ID.</p>
  
  <p>My app initialization code looks like this:</p>
  
  <pre><code>app.use(express.cookieParser(secret));
  app.use(express.session({
      key: 'sessionID',
      secret: secret,
      maxAge: new Date(Date.now() + 3600000),
      store: new RedisStore({
          client: redisClient
      })
  }));
  </code></pre>
  
  <p>Please help and point what I'm doing wrong here. Thank you</p>