MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / set_cookie

Method set_cookie

tools/python-3.11.9-amd64/Lib/http/cookiejar.py:1667–1678  ·  view source on GitHub ↗

Set a cookie, without checking whether or not it should be set.

(self, cookie)

Source from the content-addressed store, hash-verified

1665 self._cookies_lock.release()
1666
1667 def set_cookie(self, cookie):
1668 """Set a cookie, without checking whether or not it should be set."""
1669 c = self._cookies
1670 self._cookies_lock.acquire()
1671 try:
1672 if cookie.domain not in c: c[cookie.domain] = {}
1673 c2 = c[cookie.domain]
1674 if cookie.path not in c2: c2[cookie.path] = {}
1675 c3 = c2[cookie.path]
1676 c3[cookie.name] = cookie
1677 finally:
1678 self._cookies_lock.release()
1679
1680 def extract_cookies(self, response, request):
1681 """Extract cookies from response, where allowable given the request."""

Callers 4

set_cookie_if_okMethod · 0.95
extract_cookiesMethod · 0.95
_really_loadMethod · 0.45
_really_loadMethod · 0.45

Calls 2

acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected