-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Deleted cookies are not removed but shown with value=deleted #25205
Comments
@IdoAdler2 Glad to hear you are loving sessions! This is an interesting issue though. Can you provide a small reproducible example that I can run myself? Your code is using page objects and an app that I don't have access to run myself to observe what is happening. I understand your application code is likely sensitive and cannot be shared but a "dummy" example would be totally fine. Also can you explain at what point cookies are being deleted from the page? Is this during the session setup or during the test? |
@emilyrohrbough I sent you the invitation to demo project so can run it yourself, it's private, you need to accept the invitation. Thank you, I'll wait for your response https://github.com/IdoAdler2/cypress-example |
@IdoAdler2 thank you for giving me access to the example to dig in. This is an interesting issue. I removed use of cy.session() in your test example to only run the setup code standalone like: beforeEach(() => {
- cy.session(() => {
// your setup logic
- })
})
it('test 1, () => {
cy.visit(...)
...
}) I am seeing the same issue where it looks like the session-expired cookies are persisting with I ran the same login-flow manually in my browser and it looks like these cookies are being removed like you expected so something wonky is happening with Cypress's cookie management. Since this issue is happening without the use of Looks like a bug to me. I'm going to route this to my team. Thank you! |
@emilyrohrbough Just it's important to add. You still see the issue when you are not using cy.session. Because you didn't added to the configuration: |
I am experiencing the same issue when upgrading to v12 and my codebase does not use Oddly though, the server is written in php, and apparently from their documentation:
(ive also read a few php tracker issues where users are complaining this is a bug since 2005, but no movement on the issues from php core) @IdoAdler2 is your webserver also in php? From my investigation, its not cypress that is setting the cookie value = |
@IdoAdler2 I verified this behavior with Cypress 12.2.0 where this flag was removed and @darrinmn9 There were some minor cookies changes in v12 which is why this is likely observed when you upgraded. I am curious about your findings though! Super insightful. Thank you for adding this! I do wonder if we are correctly cleaning up expired cookies... |
@darrinmn9 Very very interesting!!! I guess you are right. Because our legacy web server code is also written in PHP. |
@IdoAdler2 what as the last version this worked correctly for you when using |
@emilyrohrbough For us, it starts not to work on 10.0.0. |
For me, tests were passing on v11.2.0. started failing in v12 |
@emilyrohrbough Do you have any updates? |
@IdoAdler2 would you be able to invite me the git repository? |
@AtofStryker @mschile Invited both of you to the repo. |
As a temporary workaround, you could try manually removing the // HACK: clear deleted cookies
cy.getAllCookies().then((cookies) => {
cookies.forEach((cookie) => {
if (cookie.value === 'deleted') {
cookie.expiry = 1;
cy.setCookie(cookie.name, cookie.value, cookie)
}
});
}); |
@IdoAdler2 would you be able to try this binary to see if it resolves your issue? |
@AtofStryker yes, it's resolved our issue. It's working locally, when this update will be released approximately? Thank you very much for your help. |
@ilonalink that's great to hear! My guess would be next week if we need to patch, or the following with |
@ilonalink This should be making it in today or tomorrow with 12.6.1 since we need to do a patch and it was ready to go! |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
After upgrading from version 10.7.0 to newer versions we have problems with some cookies.
Cookies deleted by our web app, stay in the session and are given 'deleted' values.
If we disable experimentalSessionAndOrigin” and do not use cy.session everything is ok.
But we must use cy.session!!! (we love it)
See hows the deleted cookies look in the image attached.
do
Desired behavior
The Cookies should disappear from the browser and not stay there with a 'deleted' value.
Our app acts weird because it acts like 'deleted' is a real value for this cookies keys.
Test code to reproduce
Cypress Version
12.0.0
Node version
v16.17.0
Operating System
MacOS 13.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: