Lines Matching refs:cookies
478 Currently, this is also used for parsing RFC 2109 cookies.
482 # RFC 2109 attrs (may turn up in Netscape cookies, too)
746 This class represents both Netscape and RFC 2965 cookies.
842 """Defines which cookies get accepted from and returned to server.
844 May also modify cookies, though this is probably a bad idea.
847 and RFC 2965 cookies -- override that if you want a customized policy.
853 Currently, pre-expired cookies never get this far -- the CookieJar
854 class deletes such cookies itself.
864 """Return false if cookies should not be returned, given cookie domain.
869 """Return false if cookies should not be returned, given cookie path.
875 """Implements the standard rules for accepting and returning cookies."""
953 strict about which cookies to accept).
976 _debug(" RFC 2965 cookies are switched off")
979 _debug(" Netscape cookies are switched off")
996 # Try and stop servers setting V0 cookies designed to hack other
1100 be more strict about which cookies to return).
1116 _debug(" RFC 2965 cookies are switched off")
1119 _debug(" Netscape cookies are switched off")
1170 # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
1247 """Collection of HTTP cookies.
1273 cookies = []
1276 _debug("Checking %s for cookies to return", domain)
1287 cookies.append(cookie)
1288 return cookies
1291 """Return a list of cookies to be returned to server."""
1292 cookies = []
1294 cookies.extend(self._cookies_for_domain(domain, request))
1295 return cookies
1297 def _cookie_attrs(self, cookies):
1306 # add cookies in order of most specific (ie. longest) path first
1307 cookies.sort(key=lambda a: len(a.path), reverse=True)
1312 for cookie in cookies:
1368 cookies = self._cookies_for_request(request)
1370 attrs = self._cookie_attrs(cookies)
1379 for cookie in cookies:
1417 # cookies should have the Expires cookie-attribute, and V1 cookies
1418 # should have Max-Age, but since V1 includes RFC 2109 cookies (and
1419 # since V0 cookies may be a mish-mash of Netscape and RFC 2109), we
1557 # in DefaultCookiePolicy, because can't delete cookies there.
1581 cookies = []
1584 if cookie: cookies.append(cookie)
1585 return cookies
1587 def _process_rfc2109_cookies(self, cookies):
1591 for cookie in cookies:
1595 # treat 2109 cookies as Netscape cookies rather than
1596 # as RFC2965 cookies
1617 cookies = self._cookies_from_attrs_set(
1621 cookies = []
1625 # RFC 2109 and Netscape cookies
1633 # Look for Netscape cookies (from Set-Cookie headers) that match
1634 # corresponding RFC 2965 cookies (from Set-Cookie2 headers).
1636 # cookie (RFC 2965 section 9.1). Actually, RFC 2109 cookies are
1637 # bundled in with the Netscape cookies for this purpose, which is
1641 for cookie in cookies:
1650 cookies.extend(ns_cookies)
1652 return cookies
1681 """Extract cookies from response, where allowable given the request."""
1693 """Clear some cookies.
1695 Invoking this method without arguments will clear all cookies. If
1696 given a single argument, only cookies belonging to that domain will be
1697 removed. If given two arguments, cookies belonging to the specified
1712 "domain must be given to remove cookies by path")
1720 """Discard all session cookies.
1722 Note that the .save() method won't save session cookies anyway, unless
1735 """Discard all expired cookies.
1737 You probably don't need to call this method: expired cookies are never
1740 .save() method won't save expired cookies anyway (unless you ask
1757 """Return number of contained cookies."""
1792 """Save cookies to a file."""
1796 """Load cookies from a file."""
1806 """Clear all cookies and reload cookies from a saved file.
1864 doesn't lose information about RFC 2965 cookies.
1873 """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers.
1985 WARNING: you may want to backup your browser's cookies file if you use
1986 this class to save cookies. I *think* it works, but there have been
1990 load cookies to and from a file. This class uses the Mozilla/Netscape
1991 `cookies.txt' format. curl and lynx use this file format, too.
1993 Don't expect cookies saved while the browser is running to be noticed by
1994 the browser (in fact, Mozilla on unix will overwrite your saved cookies if
1998 Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to
1999 Netscape cookies on saving.
2009 slightly different headers. The class saves cookies using the Netscape
2019 "%r does not look like a Netscape format cookies file" %
2049 # cookies.txt regards 'Set-Cookie: foo' as a cookie
2084 raise LoadError("invalid Netscape format cookies file %r: %r" %
2113 # cookies.txt regards 'Set-Cookie: foo' as a cookie