CookieJar

interface CookieJar

Gives access to the cookies of a Browser, across every tab and window it owns.

Cookies are handled at browser level rather than per tab, so reading or writing them through any tab of the same browser yields the same jar.

Inheritors

Types

Link copied to clipboard
object Companion

Defaults shared by every CookieJar.

Functions

Link copied to clipboard
abstract suspend fun clear()

Removes every cookie from the browser, for all of its tabs and windows.

Link copied to clipboard
abstract suspend fun getAll(): List<<Error class: unknown class>>

Returns every cookie currently held by the browser.

Link copied to clipboard
abstract suspend fun load(path: Path = Path(DEFAULT_SESSION_FILE), pattern: <Error class: unknown class> = Regex(".*")): List<<Error class: unknown class>>

Restores cookies previously written by save and hands them to the browser.

Link copied to clipboard
abstract suspend fun save(path: Path = Path(DEFAULT_SESSION_FILE), pattern: <Error class: unknown class> = Regex(".*")): List<<Error class: unknown class>>

Writes the cookies to path as JSON, so a later load can restore the session.

Link copied to clipboard
abstract suspend fun setAll(cookies: List<<Error class: unknown class>>)

Adds the given cookies to the browser, replacing any that already exist with the same name, domain and path. Cookies absent from cookies are left untouched, use clear to drop them.