DefaultCookieJar

open class DefaultCookieJar(browser: Browser) : CookieJar

Default CookieJar, talking to the browser over its own connection.

Cookies live at browser level, so every call goes through Browser.connection rather than through one of the tabs.

Constructors

Link copied to clipboard
constructor(browser: Browser)

Functions

Link copied to clipboard
open suspend override fun clear()

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

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

Returns every cookie currently held by the browser.

Link copied to clipboard
open suspend override fun load(path: Path, pattern: <Error class: unknown class>): List<<Error class: unknown class>>

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

Link copied to clipboard
open suspend override fun save(path: Path, pattern: <Error class: unknown class>): List<<Error class: unknown class>>

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

Link copied to clipboard
open suspend override 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.