Pyjo.Cookie inherits all methods from Pyjo.Base and Pyjo.String.Mixin and implements the following new ones.

__bool__() → bool[source]
boolean = bool(cookie)

Always true.

__str__() → str[source]
string = str(cookie)

Alias for to_str().

name
name = cookie.name
cookie.name = 'foo'

Cookie name.

classmethod parse(string: str | BaseCookie[str] | None = None) → list[C][source]
cookies = cookie.parse(string)

Parse cookies. Meant to be overloaded in a subclass.

to_morsel() → Morsel[str][source]
morsel = cookie.to_morsel()

Turn cookie into a http.cookies.Morsel, for the standard library.

# "foo="b r""
Pyjo.Cookie.Request.new(name='foo', value='b r').to_morsel().OutputString()
to_str() → str[source]
string = cookie.to_str()

Render cookie. Meant to be overloaded in a subclass.

value
value = cookie.value
cookie.value = '/test'

Cookie value.