The cookielib module provides client-side support for managing HTTP cookies. The primary use of this module is in conjunction with the urllib2 module, which is used to access documents on the Internet. For instance, the cookielib module can be used to capture cookies and to retransmit them on subsequent connection requests. It can also be used to work with files containing cookie data such as files created by various browsers.


Creates a new CookieJar instance that is responsible for holding HTTP cookie values, storing cookies received as a result of HTTP requests, and adding cookies to outgoing HTTP requests. policy is an instance of CookiePolicy. The purpose of policy is to define various handling rules regarding ...

Get Python: Essential Reference, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.