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

Method extract_cookies

Lib/http/cookiejar.py:1681–1691  ·  view source on GitHub ↗

Extract cookies from response, where allowable given the request.

(self, response, request)

Source from the content-addressed store, hash-verified

1679 self._cookies_lock.release()
1680
1681 def extract_cookies(self, response, request):
1682 """Extract cookies from response, where allowable given the request."""
1683 _debug("extract_cookies: %s", response.info())
1684 self._cookies_lock.acquire()
1685 try:
1686 for cookie in self.make_cookies(response, request):
1687 if self._policy.set_ok(cookie, request):
1688 _debug(" setting cookie: %s", cookie)
1689 self.set_cookie(cookie)
1690 finally:
1691 self._cookies_lock.release()
1692
1693 def clear(self, domain=None, path=None, name=None):
1694 """Clear some cookies.

Callers 11

test_domain_allowMethod · 0.95
test_domain_blockMethod · 0.95
test_secure_blockMethod · 0.95
test_netscape_miscMethod · 0.95
test_empty_pathMethod · 0.95
test_session_cookiesMethod · 0.95
http_responseMethod · 0.45

Calls 7

make_cookiesMethod · 0.95
set_cookieMethod · 0.95
_debugFunction · 0.85
infoMethod · 0.45
acquireMethod · 0.45
set_okMethod · 0.45
releaseMethod · 0.45

Tested by 10

test_domain_allowMethod · 0.76
test_domain_blockMethod · 0.76
test_secure_blockMethod · 0.76
test_netscape_miscMethod · 0.76
test_empty_pathMethod · 0.76
test_session_cookiesMethod · 0.76