Hi, same here,
I just switched to Express 3.0.0alpha1 and req.sessionID is different from Express 2.x
It seems the sessionStore keys are now the shorter uid(24)-only version and no longer the 'long' version (described in the above post) stored in the cookie.
I use
socket.io and the technique described here:
http://www.danielbaulig.de/socket-ioexpress/ to retrieve the Express sessions...
My 'problem' is that in
socket.io's handshake, I retrieve the cookie's 'express.sid' value which is the full one stored in the cookie... therefore it's no longer the key for the Express session in the sessionStore...
data.sessionID = cookie['express.sid']; //the long/full version stored in the cookie
sessionStore.load(data.sessionID, function(err, session) {
//session not loaded... undefined...
});
For the moment I fixed it doing a simple split('.')[0] to retrieve the uid(24) part:
data.sessionID = cookie['express.sid'].split('.')[0];
sessionStore.load(data.sessionID, function(err, session) {
//session loaded OK...
});
Just like Allan hansen I'd like to know if indeed the req.sessionID is now supposed to be only the uid(24) part of the whole cookie express.sid
and if the technique I used to retrieve the session within
socket.io is the way to go from now on or is there (probably) a better/cleaner way to do it?
thank you,
thibaud