cookielib.CookiePolicy

class cookielib.CookiePolicy[source]

Defines which cookies get accepted from and returned to server.

May also modify cookies, though this is probably a bad idea.

The subclass DefaultCookiePolicy defines the standard rules for Netscape and RFC 2965 cookies – override that if you want a customised policy.

Methods

domain_return_ok(domain, request) Return false if cookies should not be returned, given cookie domain.
path_return_ok(path, request) Return false if cookies should not be returned, given cookie path.
return_ok(cookie, request) Return true if (and only if) cookie should be returned to server.
set_ok(cookie, request) Return true if (and only if) cookie should be accepted from server.