title: Unable to access the user session in socket.io by parsing the cookie
body: <p>I am tring to access the user session into my socket connection in order to accept/refuse it.</p>
  
  <p>The problem is, i do get a <code>sessionId string</code> but the session i get with <code>SessionStore.get()</code> is <code>undefined</code>.</p>
  
  <p>I guess the problem could be that i never "signed" the sessionId after getting it (<code>data.cookie['connect.sid']</code>), but i didn't see any way to do it with the <code>cookie</code> module.</p>
  
  <pre><code>var MongoStore = require('connect-mongo')(express);
  var SessionStore = new MongoStore({ db: "test" });
  var parseCookie = require('cookie').parse;
  
  app.use(express.session({
          secret: 'test',
          store: SessionStore
      }));
  
  io.set('authorization', function(data, accept) {
      if (data.headers.cookie) {
          data.cookie = parseCookie(data.headers.cookie);
          data.sessionID = data.cookie['connect.sid'];
          console.log('sessionId: '+data.sessionID);
          SessionStore.get(data.sessionID, function(err, session) {
              if (err || !session) {
                  console.log('err: '+err);
                  console.log('Session: '+session);
                  accept('Error', false);
              } else {
                  data.session = session;
                  accept(null, true);
              }
          });
      } else {
         return accept('No cookie transmitted.', false);
      }
  });
  </code></pre>
  
  <p>Maybe someone see what i am missing here?</p>