Skip to content

Session ID differences between client and server #1275

Answered by miguelgrinberg
jamesbraza asked this question in Q&A
Discussion options

You must be logged in to vote

You are mixing up two different identifiers. The Socket.IO protocol assigns an identifier to the Engine.IO transport, and a different one for each connected Socket.IO namespace. The sid that you get in the server on the connect handler is the Socket.IO identifier. But the sio_client.sid that you are printing on the client is actually a private variable of the client, not supposed to be used by the application. Instead, use sio_client.get_sid() to get the identifier for the Socket.IO session associated with the default namespace. documentation link

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jamesbraza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants