http.cookiejar.CookieJar.make_cookies()

CookieJar.make_cookies(response, request) Return sequence of Cookie objects extracted from response object. See the documentation for extract_cookies() for the interfaces required of the response and request arguments.

http.cookiejar.CookieJar.set_cookie()

CookieJar.set_cookie(cookie) Set a Cookie, without checking with policy to see whether or not it should be set.

http.cookiejar.CookieJar.set_cookie_if_ok()

CookieJar.set_cookie_if_ok(cookie, request) Set a Cookie if policy says it’s OK to do so.

http.cookiejar.CookieJar.set_policy()

CookieJar.set_policy(policy) Set the CookiePolicy instance to be used.

http.cookiejar.CookiePolicy

class http.cookiejar.CookiePolicy This class is responsible for deciding whether each cookie should be accepted from / returned to the server.

http.cookiejar.CookiePolicy.domain_return_ok()

CookiePolicy.domain_return_ok(domain, request) Return false if cookies should not be returned, given cookie domain. This method is an optimization. It removes the need for checking every cookie with a particular domain (which might involve reading many files). Returning true from domain_return_ok() and path_return_ok() leaves all the work to return_ok(). If domain_return_ok() returns true for the cookie domain, path_return_ok() is called for the cookie path. Otherwise, path_return_ok() and r

http.cookiejar.CookieJar.clear()

CookieJar.clear([domain[, path[, name]]]) Clear some cookies. If invoked without arguments, clear all cookies. If given a single argument, only cookies belonging to that domain will be removed. If given two arguments, cookies belonging to the specified domain and URL path are removed. If given three arguments, then the cookie with the specified domain, path and name is removed. Raises KeyError if no matching cookie exists.

http.cookiejar.CookieJar.clear_session_cookies()

CookieJar.clear_session_cookies() Discard all session cookies. Discards all contained cookies that have a true discard attribute (usually because they had either no max-age or expires cookie-attribute, or an explicit discard cookie-attribute). For interactive browsers, the end of a session usually corresponds to closing the browser window. Note that the save() method won’t save session cookies anyway, unless you ask otherwise by passing a true ignore_discard argument.

http.cookiejar.CookieJar

class http.cookiejar.CookieJar(policy=None) policy is an object implementing the CookiePolicy interface. The CookieJar class stores HTTP cookies. It extracts cookies from HTTP requests, and returns them in HTTP responses. CookieJar instances automatically expire contained cookies when necessary. Subclasses are also responsible for storing and retrieving cookies from a file or database.

http.cookiejar.CookieJar.add_cookie_header()

CookieJar.add_cookie_header(request) Add correct Cookie header to request. If policy allows (ie. the rfc2965 and hide_cookie2 attributes of the CookieJar‘s CookiePolicy instance are true and false respectively), the Cookie2 header is also added when appropriate. The request object (usually a urllib.request..Request instance) must support the methods get_full_url(), get_host(), get_type(), unverifiable(), has_header(), get_header(), header_items(), add_unredirected_header() and origin_req_hos