PyDocs

Nav

Internet Protocols and Support

DefaultCookiePolicy

  • DefaultCookiePolicy(blocked_domains=None, allowed_domains=None, netscape=True, rfc2965=False, rfc2109_as_netscape=None, hide_cookie2=False, strict_domain=False, strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False, strict_ns_domain=DefaultCookiePolicy.DomainLiberal, strict_ns_set_initial_dollar=False, strict_ns_set_path=False, secure_protocols=('https', 'wss'))
Implements the standard rules for accepting and returning cookies.
Members of DefaultCookiePolicy

a

allowed_domains
Return None, or the sequence of allowed domains (as a tuple).

b

blocked_domains
Return the sequence of blocked domains (as a tuple).

d

DomainLiberal
Equivalent to 0 (that is, all of the above Netscape domain strictness flags switched off).
DomainRFC2965Match
When setting cookies, require a full RFC 2965 domain-match.
DomainStrict
Equivalent to DomainStrictNoDots|DomainStrictNonDomain.
DomainStrictNoDots
When setting cookies, the ‘host prefix’ must not contain a dot (for example, www.foo.bar.com can’t set a cookie for .bar.com, because www.foo contains a dot).
DomainStrictNonDomain
Cookies that did not explicitly specify a domain cookie-attribute can only be returned to a domain equal to the domain that set the cookie (for example, spam.example.com won’t be returned cookies fro…

i

is_blocked
Return True if domain is on the blocklist for setting or receiving cookies.
is_not_allowed
Return True if domain is not on the allowlist for setting or receiving cookies.

r

rfc2109_as_netscape
If true, request that the CookieJar instance downgrade RFC 2109 cookies (that is, cookies received in a Set-Cookie header with a version cookie-attribute of 1) to Netscape cookies by setting the vers…

s

set_allowed_domains
Set the sequence of allowed domains, or None.
set_blocked_domains
Set the sequence of blocked domains.
strict_domain
Don’t allow sites to set two-component domains with country-code top-level domains like .co.uk, .gov.uk, .co.nz.etc.
strict_ns_domain
Flags indicating how strict to be with domain-matching rules for Netscape cookies.
strict_ns_set_initial_dollar
Ignore cookies in Set-Cookie: headers that have names starting with '$'.
strict_ns_set_path
Don’t allow setting cookies whose path doesn’t path-match request URI.
strict_ns_unverifiable
Apply RFC 2965 rules on unverifiable transactions even to Netscape cookies.
strict_rfc2965_unverifiable
Follow RFC 2965 rules on unverifiable transactions (usually, an unverifiable transaction is one resulting from a redirect or a request for an image hosted on another site).
0 Examples
No examples for http.cookiejar/DefaultCookiePolicy.
See Also
No see-alsos for http.cookiejar/DefaultCookiePolicy
0 Notes
No notes for DefaultCookiePolicy