soup.cookie_jar
Module for [CookieJar] class
Types 3
Automatic cookie handling for SoupSession.
A #SoupCookieJar stores soup.cookie.Cookies and arrange for them to be sent with the appropriate soup.message.Messages. #SoupCookieJar implements soup.session_feature.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
CookieJarGidBuilder builder() static nothrowGet builder for [soup.cookie_jar.CookieJar] Returns: New builder objectsoup.types.CookieJarAcceptPolicy acceptPolicy() @property nothrowGet `acceptPolicy` property. Returns: The policy the jar should follow to accept or reject cookies.void acceptPolicy(soup.types.CookieJarAcceptPolicy propval) @property nothrowSet `acceptPolicy` property. Params: propval = The policy the jar should follow to accept or reject cookies.bool readOnly() @property nothrowGet `readOnly` property. Returns: Whether or not the cookie jar is read-only.void addCookieFull(soup.cookie.Cookie cookie, glib.uri.Uri uri = null, glib.uri.Uri firstParty = null) nothrowAdds cookie to jar.void addCookieWithFirstParty(glib.uri.Uri firstParty, soup.cookie.Cookie cookie) nothrowAdds cookie to jar.soup.cookie.Cookie[] allCookies() nothrowConstructs a [glib.list.List] with every cookie inside the jar.soup.types.CookieJarAcceptPolicy getAcceptPolicy() nothrowGets jar's [soup.types.CookieJarAcceptPolicy]. Returns: the #SoupCookieJarAcceptPolicy set in the jarsoup.cookie.Cookie[] getCookieList(glib.uri.Uri uri, bool forHttp) nothrowRetrieves 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) nothrowThis 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) nothrowRetrieves (in Cookie-header form) the list of cookies that would be sent with a request to uri.bool isPersistent() nothrowGets whether jar stores cookies persistenly. Returns: true if jar storage is persistent or false otherwise.void setAcceptPolicy(soup.types.CookieJarAcceptPolicy policy) nothrowSets policy as the cookie acceptance policy for jar.void setCookie(glib.uri.Uri uri, string cookie) nothrowAdds 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) nothrowAdds 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) nothrowConnect to `Changed` signal.classCookieJarGidBuilderImpl(T) : gobject.object.ObjectWrapGidBuilderImpl!T, soup.session_feature.SessionFeatureGidBuilderImpl!T
Fluent builder implementation template for soup.cookie_jar.CookieJar
Methods
T acceptPolicy(soup.types.CookieJarAcceptPolicy propval) nothrowSet `acceptPolicy` property. Params: propval = The policy the jar should follow to accept or reject cookies. Returns: Builder instance for fluent chainingT readOnly(bool propval) nothrowSet `readOnly` property. Params: propval = Whether or not the cookie jar is read-only. Returns: Builder instance for fluent chainingFluent builder for soup.cookie_jar.CookieJar