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)
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)
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)