Module cookielib :: Class DefaultCookiePolicy
[hide private]
[frames] | no frames]

_ClassType DefaultCookiePolicy

CookiePolicy --+
               |
              DefaultCookiePolicy

Implements the standard rules for accepting and returning cookies.

Instance Methods [hide private]
 
__init__(self, 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=0, strict_ns_set_initial_dollar=False, strict_ns_set_path=False)
Constructor arguments should be passed as keyword arguments only.
 
blocked_domains(self)
Return the sequence of blocked domains (as a tuple).
 
set_blocked_domains(self, blocked_domains)
Set the sequence of blocked domains.
 
is_blocked(self, domain)
 
allowed_domains(self)
Return None, or the sequence of allowed domains (as a tuple).
 
set_allowed_domains(self, allowed_domains)
Set the sequence of allowed domains, or None.
 
is_not_allowed(self, domain)
 
set_ok(self, cookie, request)
If you override .set_ok(), be sure to call this method.
 
set_ok_version(self, cookie, request)
 
set_ok_verifiability(self, cookie, request)
 
set_ok_name(self, cookie, request)
 
set_ok_path(self, cookie, request)
 
set_ok_domain(self, cookie, request)
 
set_ok_port(self, cookie, request)
 
return_ok(self, cookie, request)
If you override .return_ok(), be sure to call this method.
 
return_ok_version(self, cookie, request)
 
return_ok_verifiability(self, cookie, request)
 
return_ok_secure(self, cookie, request)
 
return_ok_expires(self, cookie, request)
 
return_ok_port(self, cookie, request)
 
return_ok_domain(self, cookie, request)
 
domain_return_ok(self, domain, request)
Return false if cookies should not be returned, given cookie domain.
 
path_return_ok(self, path, request)
Return false if cookies should not be returned, given cookie path.
Class Variables [hide private]
  DomainStrictNoDots = 1
  DomainStrictNonDomain = 2
  DomainRFC2965Match = 4
  DomainLiberal = 0
  DomainStrict = 3
Method Details [hide private]

set_ok(self, cookie, request)

 

If you override .set_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to accept).

Overrides: CookiePolicy.set_ok

return_ok(self, cookie, request)

 

If you override .return_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to return).

Overrides: CookiePolicy.return_ok

domain_return_ok(self, domain, request)

 

Return false if cookies should not be returned, given cookie domain.

Overrides: CookiePolicy.domain_return_ok
(inherited documentation)

path_return_ok(self, path, request)

 

Return false if cookies should not be returned, given cookie path.

Overrides: CookiePolicy.path_return_ok
(inherited documentation)