Skip to content

fix cookies import when create the websocket #1080

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

Merged
merged 2 commits into from
Sep 27, 2018

Conversation

hschouman
Copy link

The upgrade to web socket should import only cookies relative to the url.
Without this specify, all cookies are imported and in my case it never upgrade to web socket (because there are several cookies in header that does not match the session)

@hschouman
Copy link
Author

For more information on my use case with cookies here, I use session affinity on heroku :
https://devcenter.heroku.com/articles/session-affinity

But I guess there are other use cases with cookies here

@nuclearace
Copy link
Member

Hm, the idea for this was to allow cookies from the initial polling connection to carry over to the websocket connection.

@hschouman
Copy link
Author

Sure and you only want the cookies relative to the current connection/url or I miss something ?

@nuclearace
Copy link
Member

@hschouman Have you tested if this ever actually returns cookies? There's a scheme difference between urlWebSocketWithSid and urlPollingWithSid, and session will only ever have the polling url.

@hschouman
Copy link
Author

You are right. In my case I have the same result with the two schemes because the cookies are stored with the base url (path == "/").
I've just fixed that.

@nuclearace
Copy link
Member

@hschouman One last thing, can you change this to be opened against development?

@hschouman hschouman changed the base branch from master to development September 14, 2018 17:03
@OneSman7
Copy link
Contributor

Found this after made comment in my PR #1058 (#1058 (comment)).
This PR also fixes bug described there. It is only left to decide whether it will be better to pass filtered cookies to addHeaders method or to filter them by domain inside addHeaders method.

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

Successfully merging this pull request may close these issues.

3 participants