The cookielib module defines classes for automatic handling of HTTP cookies. It is useful for accessing web sites that require small pieces of data – cookies – to be set on the client machine by an HTTP response from a web server, and then returned to the server in later HTTP requests.
The cookielib module of Python 2 defines classes for automatic handling of HTTP cookies.
The following classes are provided:
cookielib.CookieJar
: stores HTTP cookies. It extracts cookies from HTTP requests and returns them in HTTP responses.
cookielib.FileCookieJar
: load and save cookies from a file.
cookielib.DefaultCookiePolicy
: implements the standard accept and reject rules for Netscape and RFC 2965 cookies. By default, RFC 2109 cookies are treated according to the RFC 2965 rules.
cookielib.Cookie
: represents Netscape, RFC 2109 and RFC 2965 cookies.
The cookielib
module has been renamed to http.cookiejar
in Python 3.
For more information look at https://docs.python.org/2/library/cookielib.html