LearnBoost/socket.io — Issue #586: Session update
Author: JonnyBGod
Created: 2011-10-19 17:56:58+00:00
State: open

Hi,

I ran into a problem with sessions within socket.io.

Everything works as sopposed until a users logs in... Problem is that changing the session like example:

app.get('log/:id?', function(req, res){
...
req.session.auth.userId = user.id;
});

and then if client send a message:

socket.on('message', function(message){
console.log(hs.session.auth.user.ID);
});

Problem is that the session has not changed. Actually it only changes after a couple of seconds (sometimes several seconds).

Any idea of whats causing this? Any way to update the socket session at the same time as the express session?

Thank you in advance.
Joao Ribeiro