Skip to content

Session update #586

Closed
Closed
@JonnyBGod

Description

@JonnyBGod

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions