-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Multi-domain: Improve cookie handling #20685
Comments
We believe this update will also correct the following issues: #21363 |
@chrisbreiding @cy-veronica @cypress-app-bot Any update on this ticket, we are waiting for release? |
The code for this is done in cypress-io/cypress#22320, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
What would you like?
The SameSite cookie handling implemented in #20450 is a stop-gap measure to make it work for the experimental release of multi-domain, coercing multi-domain cookies to have
SameSite=None
.For the GA release of multi-domain support, instead of mutating cookies, the strategy should be the following:
X-Set-Cookie
so it's clear the cookies are not being set by standard means* I did a proof of concept where I set the cookies on the browser's cookie jar. In that case, they do get set but still aren't attached to requests, so we still have to attach them ourselves. Getting the cookies from automation to attach them worked fine in Chrome, but would not work in Firefox. Further investigation into fixing that could be done, but there's also increased latency per request involved in that approach too, whereas using our own cookie jar should be much faster. We just need to make sure it behaves like the browser's (e.g. unsetting the cookie when expired).
NOTE: Make sure to update the feature overview readme after changing this behavior, since it references the old behavior.
Why is this needed?
We need cookies to work as they would normally for the sake of authentication in multi-domain. The experimental release version is not ideal, since it relies on mutating all cookies to be
SameSite=None
and also needs a potentially brittle workaround for Firefox localhost cookies.The proposed solution can be more nuanced. It can set cookies from responses and attach cookies to requests the way the browser would in a non-iframe situation. The user will still be able to see the cookies in the DevTools Network tab on requests as they were sent by the response instead of our mutated version.
Other
No response
The text was updated successfully, but these errors were encountered: