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
cy.request unable to handle Same-Site: None
cookie for cross origin requests
#6757
Comments
Issue to allow |
@jennifer-shehane Good. That might be a good first step. However, I think it still won't solve this issue. It might need extra work. |
Here is the latest draft spec I can find for SameSite: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-05 It's still not a standard, but I guess it might as well be since the browsers are shipping it as stable The Cypress networking layer doesn't know about SameSite and will discard it from incoming requests that are manually handled (like |
Great! That sounds awesome! Thank you! FYI, |
Curious that Electron works for you, we're shipping Electron 8.1.1 which includes Chromium 80.0.3987.141, which is > the versions you mentioned using. I wonder why that is. |
@flotwig the new SameSite behavior is not bound to a specific version, but rather "being rolled out to Chrome 80 Stable users through gradually increasing rollouts": https://www.chromium.org/updates/same-site You can explicitely enable/disable the behavior in chrome://flags, though. |
@jklingen Awesome! That's amazing. I was running of Electron. But honestly Chrome is so much better for test running. Due to it's DevTools debugger. Electron has it too but let's be honest :) For anyone experiencing this issue. You can |
The code for this is done in cypress-io/cypress#6778, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Facts:
cy.request
should persist cookies received in response headers. It does it just fine except this used case described below.Behaviour before chrome update (expected behaviour):
cy.request
to login to our server before running tests:This was just fine and it would set a cookie for chrome browser.

Then I can run my tests against a local instance of my app at
http://localhost:3003
while the app requests cross-origin resources fromdev.xxxx.org
. The serverdev.xxxx.org
knows I am logged in because with each request my Chrome provides session id cookie.Behavior after chrome update (current behavior)
cy.request
as in the case above. But cypress fails to persist the cookie due to the following Chrome security complains:Long story short: Chrome is complaining it can't store my session id cookie because it's missing
SameSite=None and Secure
attributes.The problem is that the attributes are NOT missing. Look at raw output here:

Conclusions
I believe that cypress swallows the
Same-Site
attribute while persisting cookies fromcy.request
A hint is is also that

cy.setCookie
is completely missingSame-Site
parameter:Temporary solution
Versions
80.0.3987.122
or80.0.3987.132
. It was fine with earlier versions of Chrome including (80.*)The text was updated successfully, but these errors were encountered: