# HTTPCookie

from pandac.PandaModules import HTTPCookie

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

## Inheritance:

HTTPCookie:

## Methods of HTTPCookie:

HTTPCookie (Constructor)
clearExpires
getDomain
getExpires
getName
getPath
getSecure
getValue
hasExpires
isExpired
matchesUrl
operator <
output
parseSetCookie
setDomain
setExpires
setName
setPath
setSecure
setValue
updateFrom

HTTPCookie HTTPCookie::HTTPCookie(void); Description: Constructs an empty cookie. Description: 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. Description: 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.

clearExpires void HTTPCookie::clear_expires(void); Description: Removes the expiration date on the cookie.

getDomain string const &HTTPCookie::get_domain(void) const; Description:

getExpires HTTPDate HTTPCookie::get_expires(void) const; Description: Returns the expiration date of the cookie if it is set, or an invalid date if it is not.

getName string const &HTTPCookie::get_name(void) const; Description: Returns the name of the cookie. This is the key value specified by the server.

getPath string const &HTTPCookie::get_path(void) const; Description: Returns the prefix of the URL paths on the server for which this cookie will be sent.

getSecure bool HTTPCookie::get_secure(void) const; Description: Returns true if the server has indicated this is a "secure" cookie which should only be sent over an HTTPS channel.

getValue string const &HTTPCookie::get_value(void) const; Description: Returns the value of the cookie. This is the arbitrary string associated with the cookie's name, as specified by the server.

hasExpires bool HTTPCookie::has_expires(void) const; Description: Returns true if the cookie has an expiration date, false otherwise.

isExpired bool HTTPCookie::is_expired(HTTPDate const &now = ((now()))) const; Description: Returns true if the cookie's expiration date is before the indicated date, false otherwise.

matchesUrl bool HTTPCookie::matches_url(URLSpec const &url) const; Description: Returns true if the cookie is appropriate to send with the indicated URL request, false otherwise.

operator < bool HTTPCookie::operator <(HTTPCookie const &other) const; Description: The sorting operator allows the cookies to be stored in a single dictionary; it returns nonequal only if the cookies are different in name, path, or domain.

output void HTTPCookie::output(ostream &out) const; Description:

parseSetCookie bool HTTPCookie::parse_set_cookie(string const &format, URLSpec const &url); Description: 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.

setDomain void HTTPCookie::set_domain(string const &domain); Description:

setExpires void HTTPCookie::set_expires(HTTPDate const &expires); Description:

setName void HTTPCookie::set_name(string const &name); Description:

setPath void HTTPCookie::set_path(string const &path); Description:

setSecure void HTTPCookie::set_secure(bool flag); Description:

setValue void HTTPCookie::set_value(string const &value); Description:

updateFrom void HTTPCookie::update_from(HTTPCookie const &other); Description: 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.