It derives from <GObject>.
Automatic cookie handling for SoupSession.
A CookieJar stores Cookies and arrange for them to be sent
with the appropriate Messages. CookieJar implements
SessionFeature, so you can add a cookie jar to a session with
Session.add_feature or Session.add_feature_by_type.
Note that the base CookieJar class does not support any form of
long-term cookie persistence.
parent-instanceThe policy the jar should follow to accept or reject cookies.
Its value is a
<SoupCookieJarAcceptPolicy> (or, to
set it, one of its symbols).
Set it with (set! (cookie-jar:accept-policy self) value).
Whether or not the cookie jar is read-only.
Its value is a boolean.
It can only be set when the object is made, with #:read-only.
Adds cookie to self.
Emits the "changed" signal if we are modifying an existing cookie
or adding a valid new cookie (’valid’ means that the cookie’s expire
date is not in the past).
cookie will be ’stolen’ by the jar, so don’t free it afterwards.
Passed: a <SoupCookieJar>.
Passed: a <SoupCookie>.
Adds cookie to self.
Emits the "changed" signal if we are modifying an existing cookie
or adding a valid new cookie (’valid’ means that the cookie’s expire
date is not in the past).
first-party will be used to reject cookies coming from third party resources in case such a security policy is set in the self.
uri will be used to reject setting or overwriting secure cookies
from insecure origins. #f is treated as secure.
cookie will be ’stolen’ by the jar, so don’t free it afterwards.
Passed: a <SoupCookieJar>.
Passed: a <SoupCookie>.
Passed, or left out: a <GUri>, or #f.
the URI setting the cookie
Passed, or left out: a <GUri>, or #f.
the URI for the main document
Adds cookie to self.
Emits the "changed" signal if we are modifying an existing cookie
or adding a valid new cookie (’valid’ means that the cookie’s expire
date is not in the past).
first-party will be used to reject cookies coming from third party resources in case such a security policy is set in the self.
cookie will be ’stolen’ by the jar, so don’t free it afterwards.
For secure cookies to work properly you may want to use
CookieJar.add_cookie_full.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
the URI for the main document
Passed: a <SoupCookie>.
Constructs a <GList> with every cookie inside the self.
The cookies in the list are a copy of the original, so you have to free them when you are done with them.
For historical reasons this list is in reverse order.
Passed: a <SoupCookieJar>.
Returned: a list, each a <SoupCookie>.
a GSList with all the cookies in the self.
Deletes cookie from self.
Emits the "changed" signal.
Passed: a <SoupCookieJar>.
Passed: a <SoupCookie>.
Gets self’s CookieJarAcceptPolicy.
Passed: a <SoupCookieJar>.
Returned: a
<SoupCookieJarAcceptPolicy>.
the <SoupCookieJarAcceptPolicy> set
in the self
Retrieves the list of cookies that would be sent with a request to
uri as a <GList> of Cookie objects.
If for-http is #t, the return value will include cookies
marked "HttpOnly" (that is, cookies that the server wishes to keep
hidden from client-side scripting operations such as the JavaScript
document.cookies property). Since CookieJar sets the Cookie
header itself when making the actual HTTP request, you should almost
certainly be setting for-http to #f if you are calling
this.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
a <GUri>
Passed: a boolean.
whether or not the return value is being passed directly to an HTTP operation
Returned: a list, each a <SoupCookie>.
a GSList with the cookies in the self that would be sent
with a request to uri.
This is an extended version of CookieJar.get_cookie_list that
provides more information required to use SameSite cookies.
See the [SameSite cookies spec](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00) for more detailed information.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
a <GUri>
Passed: a <GUri>, or #f.
a <GUri> for the top level document
Passed: a <GUri>, or #f.
a <GUri> indicating the origin to get cookies for
Passed: a boolean.
whether or not the return value is being passed directly to an HTTP operation
Passed: a boolean.
if the HTTP method is safe, as defined by RFC 7231, ignored when
for-http is #f
Passed: a boolean.
whether or not the HTTP request is part of top level navigation
Returned: a list, each a <SoupCookie>.
a GSList with the cookies in the self that would be sent
with a request to uri.
Retrieves (in Cookie-header form) the list of cookies that would be sent with a request to uri.
If for-http is #t, the return value will include cookies
marked "HttpOnly" (that is, cookies that the server wishes to keep
hidden from client-side scripting operations such as the JavaScript
document.cookies property). Since CookieJar sets the Cookie
header itself when making the actual HTTP request, you should almost
certainly be setting for-http to #f if you are calling
this.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
a <GUri>
Passed: a boolean.
whether or not the return value is being passed directly to an HTTP operation
Returned: a string, or #f.
the cookies, in string form, or #f if there are no cookies for
uri.
Gets whether self stores cookies persistenly.
Passed: a <SoupCookieJar>.
Returned: a boolean.
#t if self storage is persistent or #f otherwise.
Creates a new CookieJar.
The base CookieJar class does not support persistent storage of
cookies; use a subclass for that.
Returned: a <SoupCookieJar>.
a new <SoupCookieJar>
Sets policy as the cookie acceptance policy for self.
Passed: a <SoupCookieJar>.
Passed: a
<SoupCookieJarAcceptPolicy>, or one
of its symbols.
Adds cookie to self, exactly as though it had appeared in a Set-Cookie header returned from a request to uri.
Keep in mind that if the CookieJarAcceptPolicy set is either
no-third-party or
grandfathered-third-party you’ll
need to use CookieJar.set_cookie_with_first_party, otherwise the
jar will have no way of knowing if the cookie is being set by a third
party or not.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
the URI setting the cookie
Passed: a string.
the stringified cookie to set
Adds cookie to self, exactly as though it had appeared in a Set-Cookie header returned from a request to uri.
first-party will be used to reject cookies coming from third party resources in case such a security policy is set in the self.
Passed: a <SoupCookieJar>.
Passed: a <GUri>.
the URI setting the cookie
Passed: a <GUri>.
the URI for the main document
Passed: a string.
the stringified cookie to set
Connect a handler with (connect object cookie-jar:changed
handler). It is called as (handler self old-cookie new-cookie).
Emitted when jar changes.
If a cookie has been added, new-cookie will contain the
newly-added cookie and old-cookie will be #f. If a cookie
has been deleted, old-cookie will contain the to-be-deleted cookie
and new-cookie will be #f. If a cookie has been changed,
old-cookie will contain its old value, and new-cookie its
new value.
Passed: a <SoupCookieJar>.
Passed: a <SoupCookie>, or #f.
the old <SoupCookie> value
Passed: a <SoupCookie>, or #f.
the new <SoupCookie> value
To override it in a new class, give register-type #:vfuncs
`((changed . ,procedure)). The procedure is called as
(procedure self old-cookie new-cookie).
Passed: the class whose implementation to call:
<SoupCookieJar>, or a class that derives from
it, or its GType number.
Passed: a <SoupCookieJar>.
Passed: a <SoupCookie>.
Passed: a <SoupCookie>.
Gets whether self stores cookies persistenly.
To override it in a new class, give register-type #:vfuncs
`((is-persistent . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<SoupCookieJar>, or a class that derives from
it, or its GType number.
Passed: a <SoupCookieJar>.
Returned: a boolean.
#t if self storage is persistent or #f otherwise.
To override it in a new class, give register-type #:vfuncs
`((save . ,procedure)). The procedure is called as (procedure
self).
Passed: the class whose implementation to call:
<SoupCookieJar>, or a class that derives from
it, or its GType number.
Passed: a <SoupCookieJar>.