Skip to content

[FrameworkBundle] Use correct cookie domain in loginUser() #44565

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 1 commit into from
Dec 11, 2021

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Dec 11, 2021

Q A
Branch? 5.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #43266
License MIT
Doc PR

Upon each request, we parse the cookie header from the response. This means that after a first request in the test, the session cookie has a domain (localhost), instead of ''. This breaks calling loginUser() with another user for a subsequent test.

This PR fixes this by discovering if there are already session cookies set for a specific domain, and then overriding that session.

@fabpot
Copy link
Member

fabpot commented Dec 11, 2021

Thank you @wouterj.

@fabpot fabpot merged commit 41760f3 into symfony:5.3 Dec 11, 2021
@wouterj wouterj deleted the issue-43266/user-session branch December 11, 2021 14:53
@bendavies
Copy link
Contributor

@wouterj thankyou very much, confirmed this works. any idea where the regression/bug/change crept in?

@adrienfr
Copy link
Contributor

Thanks @wouterj 🚀

This was referenced Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants