MCPcopy Index your code
hub / github.com/RustPython/RustPython / clear_expired_cookies

Method clear_expired_cookies

Lib/http/cookiejar.py:1735–1752  ·  view source on GitHub ↗

Discard all expired cookies. You probably don't need to call this method: expired cookies are never sent back to the server (provided you're using DefaultCookiePolicy), this method is called by CookieJar itself every so often, and the .save() method won't save expire

(self)

Source from the content-addressed store, hash-verified

1733 self._cookies_lock.release()
1734
1735 def clear_expired_cookies(self):
1736 """Discard all expired cookies.
1737
1738 You probably don't need to call this method: expired cookies are never
1739 sent back to the server (provided you're using DefaultCookiePolicy),
1740 this method is called by CookieJar itself every so often, and the
1741 .save() method won't save expired cookies anyway (unless you ask
1742 otherwise by passing a true ignore_expires argument).
1743
1744 """
1745 self._cookies_lock.acquire()
1746 try:
1747 now = time.time()
1748 for cookie in self:
1749 if cookie.is_expired(now):
1750 self.clear(cookie.domain, cookie.path, cookie.name)
1751 finally:
1752 self._cookies_lock.release()
1753
1754 def __iter__(self):
1755 return deepvalues(self._cookies)

Callers 1

add_cookie_headerMethod · 0.95

Calls 5

clearMethod · 0.95
is_expiredMethod · 0.80
acquireMethod · 0.45
timeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected