setCookie has the options "domain", "name", "value", "path", "secure", "httpOnly", "expiry"
setCookie should also allow setting the "sameSite" option
Cypress 3.1.0
sameSite is described in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
Where do you see the options: docs, typescript, code?
@bahmutov in the code of cypress... https://github.com/cypress-io/cypress/blob/55b352a11d0a664517ae054c67432d98abc2389e/packages/server/lib/automation/cookies.coffee#L7
https://docs.adobe.com/content/help/en/target/using/implement-target/before-implement/privacy/google-chrome-samesite-cookie-policies.html
When we have SameSite in cypress ?
Is there any progress/update on this feature? The newest version of Chrome requires sameSite to be set and so our auth process is failing, as we can't set this value from within Cypress. A workaround is using electron but this isn't sustainable/desirable. Thank you!
I'm also looking for this feature to be added. We have an app that requires sameSite to be set as True. The app requires authentication so I am passing the cookie to bypass physically logging in with the front end but it fails due to the sameSite not being set.
This can be added as soon as the code is done. @jm-hmbk @katiejduane @karenpetrie If you'd like to open a PR to speed things up, this should be a small change. @gregorybleiker has identified one of the areas that will need to be updated, and tests will need to be added in the 2_cookies_spec test.
Reading SameSite status is a breaking change that will need to wait for 5.0: #5070
@flotwig what do you mean when you say 'this can be added as soon as the code is done'? are you meaning once 5.0 is finished, one could theoretically make the change and make a PR? or are you referring to some other code? Sorry, just need a clarification! Thanks!
@katiejduane Once there is a PR merged that adds support for sameSite to cy.setCookie, it could be released with the next minor release of Cypress (currently 4.3.0) once merged. Nobody from the team is currently working on a PR for this, but contributions are welcome :smile:
Adding it to cy.getCookie is a breaking change and needs to wait for the next major release of Cypress (currently, 5.0.0)
thanks for the quick response @flotwig ...so in order to do this i'd essentially have to clone the repo, make the required changes (ONLY for cy.setCookie(), not getCookie()), push up those changes on my own branch, and make a PR? sorry if this seems like a silly question, i've never contributed or made a PR to any repo but my own or my employer's 馃槵
@katiejduane yup, that's right!
@flotwig sorry to keep bothering you with questions but i saw that issue #6757 was assigned to you. does this mean you'll make the fix or should i still do my best to fix and make a PR? happy to try, just wanted to know if I don't need to. Electron is now also failing due to the cookie being blocked, so we can't get authorized at all right now using cy.request()
@katiejduane good eye, i'll probably add a fix for this issue as part of #6757 anyways so don't worry about it for now
Just came here to figure out this issue - will eagerly await #6757 as well!
thanks @flotwig , we're essentially blocked right now (except in CI) because our application is in development, and the auth page is at a deployed URL, but the app is still sitting on localhost:3000, so a UI login is out of the question; and so can't run the tests at all. if you think there's a chance you won't have a fix for this with #6757 please let me know and i'll give it my best shot and make a PR. i'd already started making some adjustments before your most recent comments, but obviously am far, far less familiar with this code base than you are. sorry for all my own super verbose comments! 馃槵
thank you @flotwig !!! 馃榿
The code for this is done in cypress-io/cypress#6828, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 4.3.0.
This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.3.0, please open a new issue.
Most helpful comment
https://docs.adobe.com/content/help/en/target/using/implement-target/before-implement/privacy/google-chrome-samesite-cookie-policies.html
When we have SameSite in cypress ?