CookieJar

open class CookieJar(pointer: <Error class: unknown class><<Error class: unknown class>>) : SessionFeature

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 method@Session.add_feature or method@Session.add_feature_by_type.

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

Skipped during bindings generation

  • method read-only: Property has no getter nor setter

Inheritors

Constructors

Link copied to clipboard
constructor()

Creates a new #SoupCookieJar.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The policy the jar should follow to accept or reject cookies.

Link copied to clipboard
val soupCookieJarPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val soupSessionFeaturePointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun addCookie(cookie: Cookie)

Adds @cookie to @jar.

Link copied to clipboard
open fun addCookieFull(cookie: Cookie, uri: <Error class: unknown class>? = null, firstParty: <Error class: unknown class>? = null)

Adds @cookie to @jar.

Link copied to clipboard
open fun addCookieWithFirstParty(firstParty: <Error class: unknown class>, cookie: Cookie)

Adds @cookie to @jar.

Link copied to clipboard
open fun allCookies(): <Error class: unknown class>

Constructs a struct@GLib.List with every cookie inside the @jar.

Link copied to clipboard
fun connectChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (oldCookie: Cookie, newCookie: Cookie) -> Unit): <Error class: unknown class>

Emitted when @jar changes.

Link copied to clipboard
open fun deleteCookie(cookie: Cookie)

Deletes @cookie from @jar.

Link copied to clipboard
open fun getCookieList(uri: <Error class: unknown class>, forHttp: Boolean): <Error class: unknown class>

Retrieves the list of cookies that would be sent with a request to @uri as a struct@GLib.List of #SoupCookie objects.

Link copied to clipboard
open fun getCookieListWithSameSiteInfo(uri: <Error class: unknown class>, topLevel: <Error class: unknown class>? = null, siteForCookies: <Error class: unknown class>? = null, forHttp: Boolean, isSafeMethod: Boolean, isTopLevelNavigation: Boolean): <Error class: unknown class>

This is an extended version of method@CookieJar.get_cookie_list that provides more information required to use SameSite cookies.

Link copied to clipboard
open fun getCookies(uri: <Error class: unknown class>, forHttp: Boolean): String?

Retrieves (in Cookie-header form) the list of cookies that would be sent with a request to @uri.

Link copied to clipboard
open fun isPersistent(): Boolean

Gets whether @jar stores cookies persistenly.

Link copied to clipboard
open fun setCookie(uri: <Error class: unknown class>, cookie: String)

Adds @cookie to @jar, exactly as though it had appeared in a Set-Cookie header returned from a request to @uri.

Link copied to clipboard
open fun setCookieWithFirstParty(uri: <Error class: unknown class>, firstParty: <Error class: unknown class>, cookie: String)

Adds @cookie to @jar, exactly as though it had appeared in a Set-Cookie header returned from a request to @uri.