title: Modifying the session data from inside the socket.io callback
body: <p>I am currently using this stack expres, socket.io, sessionstore. I followed the article here <a href="http://www.danielbaulig.de/socket-ioexpress/">http://www.danielbaulig.de/socket-ioexpress/</a>.
  Well the problem is that i cannot modify the session values in socket.io callback.</p>
  
  <p>Access from express side works well, the item get increased after each refresh.</p>
  
  <pre><code>app.get('/mysession', function(req, res) {
    req.session.item++;
    console.log(req.session);
  
    res.render('session.jade', {
      title: 'Sample title'
    });
  });
  </code></pre>
  
  <p>Using in socket.io side it does not and here is the problem, maybe i am setting the wrong object.</p>
  
  <pre><code>var io = io.listen(app);
  io.sockets.on('connection', function(socket) {
    var handshake = socket.handshake;
    onlineCount++;
    console.log('Well done id %s', handshake.sessionID);
    handshake.session.item++;
  
    console.log(handshake.session);
  
  });
  </code></pre>
  
  <p>Here is bridge code.</p>
  
  <pre><code>io.set('authorization', function(data, accept) {
    if (data.headers.cookie) {
      data.cookie = parseCookie(data.headers.cookie);
      data.sessionID = data.cookie['express.sid'];
      sessionStore.get(data.sessionID, function(err, session) {
        if (err || !session) {
          accept('Error', false);
        } else {
          data.session = session;
          accept(null, true);
        }
      });
    } else {
      return accept('No cookie tansmitted', false);
    }
  });
  </code></pre>