MCPcopy Index your code
hub / github.com/python/cpython / set_cookie

Method set_cookie

Lib/http/cookiejar.py:1668–1679  ·  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

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

Callers 6

set_cookie_if_okMethod · 0.95
extract_cookiesMethod · 0.95
test_domain_allowMethod · 0.95
test_domain_blockMethod · 0.95
_really_loadMethod · 0.80
_really_loadMethod · 0.80

Calls 2

acquireMethod · 0.45
releaseMethod · 0.45

Tested by 2

test_domain_allowMethod · 0.76
test_domain_blockMethod · 0.76