You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cookies deleted using an 'expires' date in the past, without setting any 'max-age' property, aren't deleted properly and are still sent with requests.
This is almost exactly the same issue to the one recently fixed in DevExpress/testcafe-hammerhead#2818, but that PR focused on cookies that used only 'max-age', rather than only 'expires'.
What is the Current behavior?
We use a 3rd party Javascript library on our website that deletes its cookies using past dated expiry values like this:
document.cookie="MY_COOKIE=; path=/; expires=Sun, 18 Dec 2022 22:53:55 GMT;"// date is in the past
They do not set any 'max-age' values.
Testcafe is not deleting these past dated cookies and is still sending them with http requests
What is the Expected behavior?
Cookies with past dated expiry values should be deleted and not sent with http requests even if the cookie is not set with a max-age property
What is your public website URL? (or attach your complete example)
What is your Scenario?
Cookies deleted using an 'expires' date in the past, without setting any 'max-age' property, aren't deleted properly and are still sent with requests.
This is almost exactly the same issue to the one recently fixed in DevExpress/testcafe-hammerhead#2818, but that PR focused on cookies that used only 'max-age', rather than only 'expires'.
What is the Current behavior?
We use a 3rd party Javascript library on our website that deletes its cookies using past dated expiry values like this:
They do not set any 'max-age' values.
Testcafe is not deleting these past dated cookies and is still sending them with http requests
What is the Expected behavior?
Cookies with past dated expiry values should be deleted and not sent with http requests even if the cookie is not set with a max-age property
What is your public website URL? (or attach your complete example)
I used localhost - see 'Steps to Reproduce'
What is your TestCafe test code?
see: cookie.test.js
Your complete configuration file
No response
Your complete test report
✖ expect a deleted cookie to be gone
AssertionError: expected 'MY_COOKIE=' to deeply equal ''
-MY_COOKIE=
+''
Browser: Chrome 108.0.0.0 / macOS 10.15.7
13 | await t.navigateTo("/");
14 | await t.expect(await getCookie()).eql("MY_COOKIE=Hello");
15 |
16 | await t.click(clearCookieButton);
17 | await t.navigateTo("/");
Screenshots
No response
Steps to Reproduce
npm install
andnpm run serve
in one terminalnpm run test
in a second terminalThe crux of the issue is the deletion of the cookie using a past dated expiry in the index.html
TestCafe version
2.2.0-rc.1
Node.js version
v14.18.1
Command-line arguments
chrome test/cookie.test.js
Browser name(s) and version(s)
Chrome 108
Platform(s) and version(s)
macOS 12.6
Other
No response
The text was updated successfully, but these errors were encountered: