Lines Matching refs:cookie

468     #  Should accept unquoted cookie-attribute values?  check errata draft.
470 # Should always return quoted cookie-attribute values?
487 ## commas and equals are commonly appear in the cookie value). This also
494 ## parse it, just ignore it and pretend it's a session cookie.
539 cookie = c._cookies["www.acme.com"]["/"]["eggs"]
540 self.assertIsNone(cookie.value)
541 self.assertEqual(cookie.name, "eggs")
542 cookie = c._cookies["www.acme.com"]['/foo/']['"spam"']
543 self.assertIsNone(cookie.value)
544 self.assertEqual(cookie.name, '"spam"')
545 self.assertEqual(lwp_cookie_str(cookie), (
572 (False, False, None), # version None here means no cookie stored
583 cookie = c._cookies["www.example.com"]["/"]["ni"]
585 self.assertIsNone(version) # didn't expect a stored cookie
587 self.assertEqual(cookie.version, version)
608 cookie = c._cookies[".acme.com"]["/"]["spam"]
609 self.assertEqual(cookie.domain, ".acme.com")
610 self.assertTrue(cookie.domain_specified)
611 self.assertEqual(cookie.port, DEFAULT_HTTP_PORT)
612 self.assertFalse(cookie.port_specified)
614 self.assertTrue(cookie.has_nonstandard_attr("blArgh"))
615 self.assertFalse(cookie.has_nonstandard_attr("blargh"))
617 cookie = c._cookies["www.acme.com"]["/"]["ni"]
618 self.assertEqual(cookie.domain, "www.acme.com")
619 self.assertFalse(cookie.domain_specified)
620 self.assertEqual(cookie.port, "80,8080")
621 self.assertTrue(cookie.port_specified)
623 cookie = c._cookies["www.acme.com"]["/"]["nini"]
624 self.assertIsNone(cookie.port)
625 self.assertFalse(cookie.port_specified)
627 # invalid expires should not cause cookie to be dropped
633 cookie = c._cookies['www.acme.com']['/']['fortytwo']
634 self.assertIsNotNone(cookie.value)
635 self.assertEqual(cookie.value, '')
640 cookie = c._cookies['www.acme.com']['/']['holyhandgrenade']
641 self.assertIsNone(cookie.value)
655 # if expires is in future, keep cookie...
680 # delete both new cookie and any old matching cookie
701 cookie = Cookie(0, "name", "value",
707 self.assertEqual(cookie.expires, 1444312383)
809 cookie = c._cookies['bar.com']['/foo']['spam']
820 self.assertIn('spam=eggs', h, f"cookie not set for {path}")
821 self.assertTrue(strict_ns_path_pol.set_ok_path(cookie, req))
823 self.assertNotIn('spam=eggs', h, f"cookie set for {path}")
824 self.assertFalse(strict_ns_path_pol.set_ok_path(cookie, req))
1085 # set a cookie with non-allowed domain...
1125 # set a cookie with blocked domain...
1180 "non-secure cookie registered secure")
1183 "secure cookie registered non-secure")
1333 "Comment or CommentURL cookie-attributes returned to server")
1368 # missing domain value (invalid cookie)
1379 # missing cookie value (valid cookie)
1384 # missing cookie values for parsed attributes
1421 # cookie with invalid expires is treated as session cookie
1424 cookie = c._cookies["www.example.com"]["/"]["c"]
1425 self.assertIsNone(cookie.expires)
1465 # most specific cookie must be sent first. SHIPPING=FEDEX is the
1601 cookie = interact_2965(
1604 self.assertFalse(cookie)
1623 cookie = interact_2965(c, 'http://www.acme.com/acme/pickitem',
1626 self.assertRegex(cookie,
1645 # New cookie reflects shipping method.
1647 cookie = interact_2965(c, "http://www.acme.com/acme/shipping",
1650 self.assertRegex(cookie, r'^\$Version="?1"?;')
1651 self.assertRegex(cookie, r'Part_Number="?Rocket_Launcher_0001"?;'
1653 self.assertRegex(cookie, r'Customer="?WILE_E_COYOTE"?;'
1674 cookie = interact_2965(c, "http://www.acme.com/acme/process")
1675 self.assertRegex(cookie, r'Shipping="?FedEx"?;\s*\$Path="\/acme"')
1676 self.assertIn("WILE_E_COYOTE", cookie)
1680 # each of which it receives a new cookie. All the cookies have the same
1717 # Note that the NAME=VALUE pair for the cookie with the more specific Path
1719 # attribute, /acme. Further note that the same cookie name appears more
1722 cookie = interact_2965(c, "http://www.acme.com/acme/ammo/...")
1723 self.assertRegex(cookie, r"Riding_Rocket_0023.*Rocket_Launcher_0001")
1730 # Here, the second cookie's Path attribute /acme/ammo is not a prefix of
1731 # the request URL, /acme/parts/, so the cookie does not get forwarded to
1734 cookie = interact_2965(c, "http://www.acme.com/acme/parts/")
1735 self.assertIn("Rocket_Launcher_0001", cookie)
1736 self.assertNotIn("Riding_Rocket_0023", cookie)
1747 cookie = interact_2965(c, "http://www.acme.com",
1752 cookie = interact_2965(c, "http://www.acme.com",
1757 cookie = interact_2965(c, "http://www.a.acme.com",
1762 cookie = interact_2965(c, "http://www.a.acme.com",
1767 cookie = interact_2965(c, "http://125.125.125.125",
1772 cookie = interact_2965(c, "http://www.sol.no",
1778 cookie = interact_2965(c, "http://www.sol.no/foo/bar",
1784 cookie = interact_2965(c, "http://www.sol.no",
1790 cookie = interact_2965(
1798 cookie = interact_2965(c, "http://www.sol.no",
1806 ## cookie = interact_2965(c, "http://www.sol.no/foo/",
1810 cookie = interact_2965(c, "http://www.sol.no/<oo/",
1836 cookie = interact_2965(
1840 self.assertIn("foo=bar", cookie)
1841 self.assertRegex(cookie, version_re)
1843 cookie = interact_2965(
1845 self.assertFalse(cookie)
1848 cookie = interact_2965(c, "http://www.acme.com/\xfc")
1851 # Save / load Mozilla/Netscape cookie file format.
1872 for cookie in c:
1873 if cookie.name == "foo1":
1874 cookie.set_nonstandard_attr("HTTPOnly", "")
1908 # in the cookie value.
1923 cookie = interact_2965(c, "http://example/",
1925 self.assertIn("foo1=bar", cookie)
1928 cookie = interact_2965(c, "http://example/")
1929 self.assertIn("foo2=bar", cookie)
1935 cookie = interact_netscape(c, "http://example/",
1938 self.assertIn("foo1=bar", cookie)
1940 cookie = interact_netscape(c, "http://example/")
1941 self.assertIn("foo2=bar", cookie)
1951 # In this case, extract_cookies() must set cookie to / (root)
2001 for cookie in c:
2002 key = "%s_before" % cookie.value
2006 for cookie in c:
2007 key = "%s_after" % cookie.value
2010 # a permanent cookie got lost accidentally
2012 # a session cookie hasn't been cleared