Skip to content
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

Duplicates Cookies Are Being Added With An Extra Period Before A Subdomian #25810

Closed
o3-steven opened this issue Feb 14, 2023 · 1 comment
Closed

Comments

@o3-steven
Copy link

o3-steven commented Feb 14, 2023

Current behavior

We upgraded to Cypress 12 recently and our tests started breaking. After running through some tests it seems that cypress 12 is adding a extra cookie with same site set to Lax but with a extra period before the subdomain.
For instance:
A cookie like this
TestCookie testsubdomain.testdomain.com

Will get another cookie like this if the cookie is set again
TestCookie .testsubdomain.testdomain.com

I can also confirm that all of these extra cookies have SameSite = lax even if the original cookie did not contain it.

If you downgrade to 11.2 this behavior goes away. I can confirm that no cookies with a leading period before the subdomain are created when running this outside of cypress

Looking through some of the tests around this behavior I tried to get it to happen by visiting the page twice - no luck. A redirect is also not needed for this to occur.

Running through some combinations this did work
Navigate to a page, set cookies, subdomain.domain.com/test
Navigate to another page, set cookies, subdomain.domain.com/test2

There should be a duplicated cookie.

Desired behavior

Cypress should only add one cookie.

Test code to reproduce

I don't have a reproducible copy mainly because of time concerns but I can circle back into this if someone doesn't have an easy way of getting this setup.

Cypress Version

12+

Node version

16.15.1

Operating System

Windows 10 Pro 19045.2546

Debug Logs

No response

Other

No response

@nagash77
Copy link
Contributor

Hi @o3-steven , I believe this issue is a duplicate of #25174. I am going to close this issue as a duplicate. Please follow the other issue for updates.

@nagash77 nagash77 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants