exitmusic / math-o-magic

Node.js & Socket.IO math trivia game, with class.
http://math-o-magic.nodejitsu.com/
0 stars 0 forks source link

SessionID is not the same across socket and request objects #8

Closed exitmusic closed 12 years ago

exitmusic commented 12 years ago

Figure this out and I'll be halfway there.

exitmusic commented 12 years ago

Not sure how valid this solution is, but the following worked:

if (data.headers.cookie) {
  data.cookie = parseCookie(data.headers.cookie);
  data.sessionId = data.cookie['express.sid'];
  // Only save the part of the session id accessible by req.sessionID
  data.sessionId = data.sessionId.split(".")[0].split(":").pop();
}