code: function(sessionId, socketId, cb) {
        return api.store.get().load(sessionId, function(err, session) {
          // Create a new session if we don't have this sessionId in memory
          // Note: in production you should be using Redis or another
          // persistent store so this should rarely happen
          if (!session) {
            session = strategy.create(sessionId);
            debug('created session for %s',sessionId);
          } else {
            debug('using existing session for %s',sessionId);
          }
  
          // Append methods to session object
          session.channel = channels(ss, session, socketId);
          session.setUserId = function(userId, cb) {
            if (!cb) {
              cb = function() {};
            }
            if (userId) {
              this.userId = userId;
              this._bindToSocket();
            } else if (this.userId) {  // if null (i.e. user has signed out)
              subscriptions.user.remove(this.userId, socketId);
              delete this.userId;
            }
            return this.save(cb);
          };
  
          // Bind username and any channel subscriptions to this socketID on each request
          session._bindToSocket = function() {
            if (session.userId) {
              subscriptions.user.add(session.userId, socketId);
            }
            if ((session.channels) && session.channels.length > 0) {
              session.channel._bindToSocket();
            }
            return this;
          };
          session.save = function(cb) {
            return sessionStore.set(sessionId, session, cb);
          };
          session._bindToSocket();
          return cb(session);
        });
      }
docs: Find a session from the Connect Session Store Note: Sessions are automatically created by the connect.session() middleware when the browser makes a HTTP request