Cookie not stored correctly with Cypress #21509
Replies: 3 comments 4 replies
-
@abin53 how do you set the cookie via Cypress? have you looked into https://docs.cypress.io/api/cypress-api/cookies ? |
Beta Was this translation helpful? Give feedback.
-
In continuation to above discussion I had to remove the 'secure' attribute from my cookie to continue Still the cookie was not set in the browser for Cypress runs. I checked further to find out that: Cypress make all set-cookie response headers into one single set-cookie header which makes cookies to be set with incorrect cookie path; which makes it an issue. Attaching some screenshots: Note : multiple set cookie header present: XSRF-TOKEN is the cookie of discussion here which is set correctly with path = '/' and httpOnly as false Note : set-cookie header combined into single set-cookie. And also path '/scv' is incorrect. expected was '/' The actual path for XSRF-TOKEN cookie was '/' but with single set-cookie and now it's being wrongly set as '/scv' which breaks the application under test. Also cookie is marked as httpOnly which isn't. Probably path and httonly are taken from the last cookies(JSESSIONID) information which is incorrect Versions : |
Beta Was this translation helpful? Give feedback.
-
I am dealing with this issue as well, please revive this issue |
Beta Was this translation helpful? Give feedback.
-
When I visit my site(https) directly, the certificate is verified, however the browser launched through Cypress is showing it as "Not Secure". Cypress says this is only cosmetic issue. But because of this our application fails since browser doesn't have a cookie with secure attribute set which in non-cypress browser works fine ?
This doesn't happen while using chrome. But with other browsers like electron, pupputeer chrome etc
Any thoughts? I'm new with Cypress. Point to me if I'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions