You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just had to read code because I wanted to know what happens to the session data when a client reconnects. It turns out that a client gets a new sid on reconnect and the session data is lost.
The server can maintain application-specific information in a user session dedicated to each connected client. Applications can use the user session to write any details about the user that need to be preserved throughout the life of the connection, such as usernames or user ids.
Maybe add a sentence like "Please note that in the event of a disconnect the session is deleted and lost even if a reconnect occurs, because the client will receive a new sid."
Additional quesiton:
So if I would like, for example, save the 'logged-in' state of a client in my server I would have to save that "out of band" and manage my own client IDs? So adding a whole protocol layer on top of Socket.IO? Or is there a more idiomatic way of doing it?
The text was updated successfully, but these errors were encountered:
Each time there is a disconnection and re-connection your disconnect and connect handlers will be invoked. So from the server's side this would look exactly like a client that went away and then returned. Authentication needs to be done again, and if you were storing data in the session that data needs to be regenerated.
I agree that this should be mentioned in the docs.
I just had to read code because I wanted to know what happens to the session data when a client reconnects. It turns out that a client gets a new
sid
on reconnect and the session data is lost.Maybe add a sentence like "Please note that in the event of a disconnect the session is deleted and lost even if a reconnect occurs, because the client will receive a new
sid
."Additional quesiton:
So if I would like, for example, save the 'logged-in' state of a client in my server I would have to save that "out of band" and manage my own client IDs? So adding a whole protocol layer on top of Socket.IO? Or is there a more idiomatic way of doing it?
The text was updated successfully, but these errors were encountered: