• Home
  • Raw
  • Download

Lines Matching refs:cookies

5    :synopsis: Classes for automatic handling of HTTP cookies.
15 cookies. It is useful for accessing web sites that require small pieces of data
16 -- :dfn:`cookies` -- to be set on the client machine by an HTTP response from a
21 :rfc:`2109` cookies are parsed as Netscape cookies and subsequently treated
22 either as Netscape or RFC 2965 cookies according to the 'policy' in effect.
23 Note that the great majority of cookies on the internet are Netscape cookies.
44 cookies from a file. :exc:`LoadError` is a subclass of :exc:`OSError`.
58 The :class:`CookieJar` class stores HTTP cookies. It extracts cookies from HTTP
60 automatically expire contained cookies when necessary. Subclasses are also
61 responsible for storing and retrieving cookies from a file or database.
69 A :class:`CookieJar` which can load cookies from, and perhaps save cookies to, a
88 *blocked_domains* is a sequence of domain names that we never accept cookies
89 from, nor return cookies to. *allowed_domains* if not :const:`None`, this is a
90 sequence of the only domains for which we accept and return cookies.
91 *secure_protocols* is a sequence of protocols for which secure cookies can be
97 Netscape and :rfc:`2965` cookies. By default, :rfc:`2109` cookies (ie. cookies
100 is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are
101 'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by
109 This class represents Netscape, :rfc:`2109` and :rfc:`2965` cookies. It is not
120 Module :mod:`http.cookies`
122 :mod:`http.cookiejar` and :mod:`http.cookies` modules do not depend on each
177 Extract cookies from HTTP *response* and store them in the :class:`CookieJar`,
181 :mailheader:`Set-Cookie2` headers in the *response* argument, and store cookies
226 Clear some cookies.
228 If invoked without arguments, clear all cookies. If given a single argument,
229 only cookies belonging to that *domain* will be removed. If given two arguments,
230 cookies belonging to the specified *domain* and URL *path* are removed. If
239 Discard all session cookies.
241 Discards all contained cookies that have a true :attr:`discard` attribute
246 Note that the :meth:`save` method won't save session cookies anyway, unless you
254 Save cookies to a file.
259 *filename* is the name of file in which to save cookies. If *filename* is not
264 *ignore_discard*: save even cookies set to be discarded. *ignore_expires*: save
265 even cookies that have expired
267 The file is overwritten if it already exists, thus wiping all the cookies it
268 contains. Saved cookies can be restored later using the :meth:`load` or
274 Load cookies from a file.
276 Old cookies are kept unless overwritten by newly loaded ones.
290 Clear all cookies and reload cookies from a saved file.
300 Filename of default file in which to keep cookies. This attribute may be
306 If true, load cookies lazily from disk. This attribute should not be assigned
308 (unless the cookies on disk are changing). A :class:`CookieJar` object may
310 library lazily loads cookies.
323 A :class:`FileCookieJar` that can load from and save cookies to disk in the
324 Mozilla ``cookies.txt`` file format (which is also used by the Lynx and Netscape
329 This loses information about :rfc:`2965` cookies, and also about newer or
334 Back up your cookies before saving if you have cookies whose loss / corruption
338 Also note that cookies saved while Mozilla is running will get clobbered by
344 A :class:`FileCookieJar` that can load from and save cookies to disk in format
346 convenient if you want to store cookies in a human-readable file.
381 Return ``False`` if cookies should not be returned, given cookie domain.
405 Return ``False`` if cookies should not be returned, given cookie path.
428 indicates to the server that we understand :rfc:`2965` cookies).
433 setting and receiving any and all cookies (this is unlikely to be useful).
441 Implements the standard rules for accepting and returning cookies.
443 Both :rfc:`2965` and Netscape cookies are covered. RFC 2965 handling is switched
461 receiving cookies. There are also some strictness switches that allow you to
463 blocking some benign cookies).
497 Return whether *domain* is on the blocklist for setting or receiving cookies.
513 cookies.
522 If true, request that the :class:`CookieJar` instance downgrade :rfc:`2109` cookies
523 (ie. cookies received in a :mailheader:`Set-Cookie` header with a version
524 cookie-attribute of 1) to Netscape cookies by setting the version attribute of
526 case RFC 2109 cookies are downgraded if and only if :rfc:`2965` handling is turned
527 off. Therefore, RFC 2109 cookies are downgraded by default.
545 another site). If this is false, cookies are *never* blocked on the basis of
553 Apply :rfc:`2965` rules on unverifiable transactions even to Netscape cookies.
559 cookies. See below for acceptable values.
564 Ignore cookies in Set-Cookie: headers that have names starting with ``'$'``.
569 Don't allow setting cookies whose path doesn't path-match request URI.
578 When setting cookies, the 'host prefix' must not contain a dot (eg.
587 ``spam.example.com`` won't be returned cookies from ``example.com`` that had no
593 When setting cookies, require a full :rfc:`2965` domain-match.
617 cookie-attributes contain equivalent information, and because :rfc:`2109` cookies
619 cookies.
628 Integer or :const:`None`. Netscape cookies have :attr:`version` 0. :rfc:`2965` and
629 :rfc:`2109` cookies have a ``version`` cookie-attribute of 1. However, note that
630 :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in which
688 :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in
748 cookies (assumes Unix/Netscape convention for location of the cookies file)::
752 cj.load(os.path.join(os.path.expanduser("~"), ".netscape", "cookies.txt"))
757 :rfc:`2965` cookies, be more strict about domains when setting and returning
758 Netscape cookies, and block some domains from setting cookies or having them