HTTPCookie

from panda3d.core import HTTPCookie
class HTTPCookie

Bases:

A cookie sent from an HTTP server to be stored on the client and returned when the path and/or domain matches.

Inheritance diagram

Inheritance diagram of HTTPCookie

enum SameSite
enumerator SS_unspecified = 0
enumerator SS_lax = 1
enumerator SS_strict = 2
enumerator SS_none = 3
__init__()
__init__(param0: HTTPCookie)
__init__(format: str, url: URLSpec)

Constructs a cookie according to the indicated string, presumably the tag of a Set-Cookie header. There is no way to detect a formatting error in the string with this constructor.

__init__(name: str, path: str, domain: str)

Constructs a cookie with the indicated name, path, and domain values, but no other data. This is most useful for looking up an existing cookie in the HTTPClient.

__lt__(other: HTTPCookie) bool
clear_expires()

Removes the expiration date on the cookie.

property domain string
property expires HTTPDate
Getter

Returns the expiration date of the cookie if it is set, or an invalid date if it is not.

Setter

get_domain() str
get_expires() HTTPDate

Returns the expiration date of the cookie if it is set, or an invalid date if it is not.

get_name() str

Returns the name of the cookie. This is the key value specified by the server.

get_path() str

Returns the prefix of the URL paths on the server for which this cookie will be sent.

get_samesite() SameSite
get_secure() bool

Returns true if the server has indicated this is a “secure” cookie which should only be sent over an HTTPS channel.

get_value() str

Returns the value of the cookie. This is the arbitrary string associated with the cookie’s name, as specified by the server.

has_expires() bool

Returns true if the cookie has an expiration date, false otherwise.

is_expired(now: HTTPDate) bool

Returns true if the cookie’s expiration date is before the indicated date, false otherwise.

matches_url(url: URLSpec) bool

Returns true if the cookie is appropriate to send with the indicated URL request, false otherwise.

property name string
Getter

Returns the name of the cookie. This is the key value specified by the server.

Setter

output(out: ostream)

Separates out the parameter/value pairs of the Set-Cookie header and assigns the values of the cookie appropriate. Returns true if the header is parsed correctly, false if something is not understood.

property path string
Getter

Returns the prefix of the URL paths on the server for which this cookie will be sent.

Setter

property secure bool
Getter

Returns true if the server has indicated this is a “secure” cookie which should only be sent over an HTTPS channel.

Setter

set_domain(domain: str)
set_expires(expires: HTTPDate)
set_name(name: str)
set_path(path: str)
set_samesite(samesite: SameSite)
set_secure(flag: bool)
set_value(value: str)
update_from(other: HTTPCookie)

Assuming the operator < method, above, has already evaluated these two cookies as equal, then assign the remaining values (value, expiration date, secure flag) from the indicated cookie. This is guaranteed not to change the ordering of the cookie in a set, and so can be used to update an existing cookie within a set with new values.

property value string
Getter

Returns the value of the cookie. This is the arbitrary string associated with the cookie’s name, as specified by the server.

Setter