soup.cookie_jar

Module for [CookieJar] class

Types 3

Automatic cookie handling for SoupSession.

A #SoupCookieJar stores struct@Cookies and arrange for them to be sent with the appropriate class@Messages. #SoupCookieJar implements iface@SessionFeature, so you can add a cookie jar to a session with [soup.session.Session.addFeature] or [soup.session.Session.addFeatureByType].

Note that the base #SoupCookieJar class does not support any form of long-term cookie persistence.

Methods
GType _gType() @property
CookieJar self()Returns `this`, for use in `with` statements.
CookieJarGidBuilder builder()Get builder for [soup.cookie_jar.CookieJar] Returns: New builder object
soup.types.CookieJarAcceptPolicy acceptPolicy() @propertyGet `acceptPolicy` property. Returns: The policy the jar should follow to accept or reject cookies.
void acceptPolicy(soup.types.CookieJarAcceptPolicy propval) @propertySet `acceptPolicy` property. Params: propval = The policy the jar should follow to accept or reject cookies.
bool readOnly() @propertyGet `readOnly` property. Returns: Whether or not the cookie jar is read-only.
void addCookie(soup.cookie.Cookie cookie)Adds cookie to jar.
void addCookieFull(soup.cookie.Cookie cookie, glib.uri.Uri uri = null, glib.uri.Uri firstParty = null)Adds cookie to jar.
void addCookieWithFirstParty(glib.uri.Uri firstParty, soup.cookie.Cookie cookie)Adds cookie to jar.
soup.cookie.Cookie[] allCookies()Constructs a [glib.list.List] with every cookie inside the jar.
void deleteCookie(soup.cookie.Cookie cookie)Deletes cookie from jar.
soup.types.CookieJarAcceptPolicy getAcceptPolicy()Gets jar's `enumCookieJarAcceptPolicy`. Returns: the #SoupCookieJarAcceptPolicy set in the jar
soup.cookie.Cookie[] getCookieList(glib.uri.Uri uri, bool forHttp)Retrieves the list of cookies that would be sent with a request to uri as a [glib.list.List] of #SoupCookie objects.
soup.cookie.Cookie[] getCookieListWithSameSiteInfo(glib.uri.Uri uri, glib.uri.Uri topLevel, glib.uri.Uri siteForCookies, bool forHttp, bool isSafeMethod, bool isTopLevelNavigation)This is an extended version of [soup.cookie_jar.CookieJar.getCookieList] that provides more information required to use SameSite cookies.
string getCookies(glib.uri.Uri uri, bool forHttp)Retrieves (in Cookie-header form) the list of cookies that would be sent with a request to uri.
bool isPersistent()Gets whether jar stores cookies persistenly. Returns: true if jar storage is persistent or false otherwise.
void setAcceptPolicy(soup.types.CookieJarAcceptPolicy policy)Sets policy as the cookie acceptance policy for jar.
void setCookie(glib.uri.Uri uri, string cookie)Adds cookie to jar, exactly as though it had appeared in a Set-Cookie header returned from a request to uri.
void setCookieWithFirstParty(glib.uri.Uri uri, glib.uri.Uri firstParty, string cookie)Adds cookie to jar, exactly as though it had appeared in a Set-Cookie header returned from a request to uri.
gulong connectChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == soup.cookie.Cookie))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == soup.cookie.Cookie))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : soup.cookie_jar.CookieJar))) && Parameters!T.length < 4)Connect to `Changed` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #SoupCookieJar.
Methods
T acceptPolicy(soup.types.CookieJarAcceptPolicy propval)Set `acceptPolicy` property. Params: propval = The policy the jar should follow to accept or reject cookies. Returns: Builder instance for fluent chaining
T readOnly(bool propval)Set `readOnly` property. Params: propval = Whether or not the cookie jar is read-only. Returns: Builder instance for fluent chaining

Fluent builder for [soup.cookie_jar.CookieJar]

Methods