Skip to content

gh-135885: Fix undocumented method CookieJar.clear_expired_cookies in lib http.cookiejar #135882

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Doc/library/http.cookiejar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,26 @@
or an explicit ``discard`` cookie-attribute). For interactive browsers, the end
of a session usually corresponds to closing the browser window.

Note that the :meth:`save` method won't save session cookies anyway, unless you

Check warning on line 247 in Doc/library/http.cookiejar.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: save [ref.meth]
ask otherwise by passing a true *ignore_discard* argument.


.. method:: CookieJar.clear_expired_cookies()

Discard all expired cookies.

Discards all contained cookies that have a true :attr:`expires` attribute

Check warning on line 255 in Doc/library/http.cookiejar.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: expires [ref.attr]
(usually because their expiration time have passed)

This is a low-level function which probably don't need to be called because
expired cookies are never sent back to the server (provided using
:class:`DefaultCookiePolicy`). This method is called by :class:`CookieJar`
itself every so often. It *could* only be useful when customizing a
:class:`CookiePolicy` with an expiring logic.

Note that the :meth:`save` method won't save expired cookies anyway (unless you

Check warning on line 264 in Doc/library/http.cookiejar.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:meth reference target not found: save [ref.meth]
ask otherwise by passing a true *ignore_expires* argument).

:class:`FileCookieJar` implements the following additional methods:


Expand Down
Loading