Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrading from polling to websocket to establish a connection with the backend, causing the problem of duplicate sessionId #865

Open
cunyouchen opened this issue Sep 24, 2022 · 3 comments

Comments

@cunyouchen
Copy link

If the front end js first initiates polling requests, and then upgrades to websocket, the polling request will first generate a UUID as the sessionId, which will be added to the io field of the cookie. No matter how many connections are established later, the sessionId will be the cookie The value of io, which will cause the new connection to knock off the old one. The same browser cannot have multiple connections at the same time. I don't know whether the framework is designed in this way and has such a usage scenario, or is it a bug?
Code location:
1.AuthorizeHandler.generateOrGetSessionIdFromRequest(HttpHeaders headers); (Line 245)
2.EncoderHandler.sendMessage(); (Line 141)

@Toifyx
Copy link

Toifyx commented Sep 29, 2022

The same question, but i set randomSession true to avoid the problem.

com.corundumstudio.socketio.Configuration#randomSession = true

@cunyouchen
Copy link
Author

yes, we solved it in the same way. But I am more interested in the design, or a bug?

@Toifyx
Copy link

Toifyx commented Sep 29, 2022

yes, we solved it in the same way. But I am more interested in the design, or a bug?

sorry, i hava no idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants