Пример #1
0
 def del_cookie(self, name):
     self.cookies[name] = None
     # libsoup
     expires = 'Wed, 31-Dec-97 23:59:59 GMT'
     cookie = Cookie('deleted', expires=expires, max_age='0')
     cookie = SetCookieDataType.encode({name: cookie})
     self.soup_message.append_header('Set-Cookie', cookie)
Пример #2
0
 def test_set_cookie_decode_encode_decode(self):
     a = 'Customer="WILE_E_COYOTE"; Path="/acme"'
     b = SetCookieDataType.decode(a)
     c = SetCookieDataType.encode(b)
     d = SetCookieDataType.decode(c)
     self.assertEqual(b, d)
Пример #3
0
 def test_set_cookie_decode_encode_decode(self):
     a = 'Customer="WILE_E_COYOTE"; Path="/acme"'
     b = SetCookieDataType.decode(a)
     c = SetCookieDataType.encode(b)
     d = SetCookieDataType.decode(c)
     self.assertEqual(b, d)
Пример #4
0
 def set_cookie(self, name, value, **kw):
     self.cookies[name] = value
     # libsoup
     cookie = Cookie(value, **kw)
     cookie = SetCookieDataType.encode({name: cookie})
     self.soup_message.append_header('Set-Cookie', cookie)