Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

18.22.2 FileCookieJar subclasses and co-operation with web browsers


18.22.2 FileCookieJar subclasses and co-operation with web browsers

The following CookieJar subclasses are provided for reading and writing . Further CookieJar subclasses, including one that reads Microsoft Internet Explorer cookies, are available at http://wwwsearch.sf.net/ClientCookie/.

class MozillaCookieJar( filename, delayload=None, policy=None)
A FileCookieJar that can load from and save cookies to disk in the Mozilla cookies.txt file format (which is also used by the Lynx and Netscape browsers). Note: This loses information about RFC 2965 cookies, and also about newer or non-standard cookie-attributes such as port.

Warning: Back up your cookies before saving if you have cookies whose loss / corruption would be inconvenient (there are some subtleties which may lead to slight changes in the file over a load / save round-trip).

Also note that cookies saved while Mozilla is running will get clobbered by Mozilla.

class LWPCookieJar( filename, delayload=None, policy=None)
A FileCookieJar that can load from and save cookies to disk in format compatible with the libwww-perl library's Set-Cookie3 file format. This is convenient if you want to store cookies in a human-readable file.

See About this document... for information on suggesting changes.
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web