Skip to content

Fix cookie with an epoch Expires date not being deleted - #14064

Open
spicysharkco wants to merge 2 commits into
aio-libs:masterfrom
spicysharkco:fix-cookie-epoch-expires
Open

spicysharkco wants to merge 2 commits into
aio-libs:masterfrom
spicysharkco:fix-cookie-epoch-expires

Conversation

@spicysharkco

@spicysharkco spicysharkco commented Oct 16, 2026 •

Copy link
Copy Markdown

What do these changes do?

CookieJar ignored Expires=Thu, 01 Jan 1970 00:00:00 GMT. _parse_date() returns 0 for that date and _update_cookies() only tested the result for truthiness, so the date counted as invalid and the cookie was stored as a session cookie instead of being deleted. It now compares against None.

Tested with test_cookie_jar_epoch_expires_deletes_cookie, which fails without the change (assert 1 == 0) and passes with it.

Are there changes in behavior for the user?

A Set-Cookie whose Expires is exactly the epoch now removes the cookie, like any other past date or Max-Age=0 already does. The same line is in the 3.14 and 3.15 branches.

Is it a substantial burden for the maintainers to support this?

No, it is a one-line change.

Related issue number

None filed.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes (N/A)
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES/ folder

CookieJar treated `Expires=Thu, 01 Jan 1970 00:00:00 GMT` as an invalid
date, because `_parse_date()` returns 0 for it and the result was only
checked for truthiness. The cookie was kept as a session cookie
instead of being deleted. Compare against None instead.
@agentscanapp

agentscanapp Bot commented Oct 16, 2026

Copy link
Copy Markdown

Automation signals

Activity patterns show signs of automation.

View full analysis →

Report this account →

Evidence
  • Severe fork surge: 28 repositories forked in rapid succession (within 24 hours)
  • Very high PR volume (daily): 43 PRs within a single 24-hour window
  • High PR volume (weekly): 67 PRs within a single 7-day window
  • Rapid fork→PR pattern: 20/29 fork branches followed by upstream PRs within 38s
  • Very high PR volume: 67 PRs in 2 days
  • Highly distributed activity: Activity spread across 62 external repositories
  • 24/7 activity pattern: Active in 22 of 24 hours, with the longest break being only 2.4 hours
  • High starring rate: 23 repositories starred within 22 hours
  • (+2 more signal(s), see full analysis)

Last 5 PRs:

This is an automated analysis by AgentScan

@greptile-apps

This comment has been minimized.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Oct 16, 2026
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] This PR appears safe to merge.

Reviews (1) · Last reviewed commit: "Add changelog entry" · Reviewed by Greptile

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.09%. Comparing base (80fee66) to head (054de41).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #14064   +/-   ##
=======================================
  Coverage   99.09%   99.09%           
=======================================
  Files         135      135           
  Lines       53551    53557    +6     
  Branches     2809     2809           
=======================================
+ Hits        53067    53073    +6     
  Misses        364      364           
  Partials      120      120           
Flag Coverage Δ
Autobahn 21.69% <14.28%> (-0.01%) ⬇️
CI-GHA 98.93% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.72% <100.00%> (+<0.01%) ⬆️
OS-Windows 97.37% <100.00%> (+<0.01%) ⬆️
OS-macOS 98.24% <100.00%> (+<0.01%) ⬆️
Py-3.10 98.16% <100.00%> (+<0.01%) ⬆️
Py-3.11 98.40% <100.00%> (+<0.01%) ⬆️
Py-3.12 98.48% <100.00%> (+<0.01%) ⬆️
Py-3.13 98.48% <100.00%> (+<0.01%) ⬆️
Py-3.14 98.51% <100.00%> (+<0.01%) ⬆️
Py-3.15 98.50% <100.00%> (-0.01%) ⬇️
Py-3.15t 97.90% <100.00%> (-0.01%) ⬇️
Py-pypy-3.12 96.57% <100.00%> (-0.01%) ⬇️
VM-macos 98.24% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.72% <100.00%> (+<0.01%) ⬆️
VM-windows 97.37% <100.00%> (+<0.01%) ⬆️
cython-coverage 83.56% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codspeed

codspeed Bot commented Oct 16, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 50 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 102 untouched benchmarks
⏩ 83 skipped benchmarks1


Comparing spicysharkco:fix-cookie-epoch-expires (054de41) with master (80fee66)2

Open in CodSpeed

Footnotes

  1. 83 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on master (a53d03a) during the generation of this report, so 80fee66 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant