Tests if cookie should be sent to uri.
(At the moment, this does not check that cookie's domain matches
uri, because it assumes that the caller has already done that.
But don't rely on that; it may change in the future.)
true if cookie should be sent to uri, false if not
Checks if the cookie's domain and host match.
The domains match if cookie should be sent when making a request to host,
or that cookie should be accepted when receiving a response from host.
a URI
true if the domains match, false otherwise
Tests if cookie1 and cookie2 are equal.
Note that currently, this does not check that the cookie domains match. This may change in the future.
whether the cookies are equal.
Frees cookie.
Gets cookie's domain.
cookie's domain
Gets cookie's HttpOnly attribute.
cookie's HttpOnly attribute
Gets cookie's name.
cookie's name
Gets cookie's path.
cookie's path
Gets cookie's secure attribute.
cookie's secure attribute
Gets cookie's value.
cookie's value
Sets cookie's domain to domain.
the new domain
Sets cookie's expiration time to expires.
If expires is null, cookie will be a session cookie and will expire at the
end of the client's session.
(This sets the same property as Cookie.set_max_age.)
Sets cookie's HttpOnly attribute to http_only.
If true, cookie will be marked as "http only", meaning it should not be
exposed to web page scripts or other untrusted code.
the new value for the HttpOnly attribute
Sets cookie's max age to max_age.
If max_age is -1, the cookie is a session cookie, and will expire at the end
of the client's session. Otherwise, it is the number of seconds until the
cookie expires. You can use the constants SOUP_COOKIE_MAX_AGE_ONE_HOUR,
SOUP_COOKIE_MAX_AGE_ONE_DAY, SOUP_COOKIE_MAX_AGE_ONE_WEEK and
SOUP_COOKIE_MAX_AGE_ONE_YEAR (or multiples thereof) to calculate this value.
(A value of 0 indicates that the cookie should be considered
already-expired.)
This sets the same property as Cookie.set_expires.
the new max age
Sets cookie's name to name.
the new name
Sets cookie's path to path.
the new path
When used in conjunction with CookieJar.get_cookie_list_with_same_site_info this sets the policy of when this cookie should be exposed.
Sets cookie's secure attribute to secure.
If true, cookie will only be transmitted from the client to the server over
secure (https) connections.
the new value for the secure attribute
Sets cookie's value to value.
the new value
Serializes cookie in the format used by the Cookie header (ie, for
returning a cookie from a Session to a server).
the header
Serializes cookie in the format used by the Set-Cookie header.
i.e. for sending a cookie from a Server to a client.
the header
StaticnewStaticparseParses header and returns a Cookie.
If header contains multiple cookies, only the first one will be parsed.
If header does not have "path" or "domain" attributes, they will
be defaulted from origin. If origin is null, path will default
to "/", but domain will be left as null. Note that this is not a
valid state for a Cookie, and you will need to fill in some
appropriate string for the domain if you want to actually make use
of the cookie.
As of version 3.4.0 the default value of a cookie's same-site-policy is Soup.SameSitePolicy.LAX.
Implements HTTP cookies, as described by RFC 6265.
To have a Session handle cookies for your appliction automatically, use a CookieJar.
nameandvaluewill be set for all cookies. If the cookie is generated from a string that appears to have no name, thennamewill be the empty string.domainandpathgive the host or domain, and path within that host/domain, to restrict this cookie to. Ifdomainstarts with ".", that indicates a domain (which matches the string after the ".", or any hostname that hasdomainas a suffix). Otherwise, it is a hostname and must match exactly.expireswill be non-nullif the cookie uses either the original "expires" attribute, or the newer "max-age" attribute. Ifexpiresisnull, it indicates that neither "expires" nor "max-age" was specified, and the cookie expires at the end of the session.If
http_onlyis set, the cookie should not be exposed to untrusted code (eg, javascript), so as to minimize the danger posed by cross-site scripting attacks.