CookieStore

The CookieStore interface of the Cookie Store API provides methods for getting and setting cookies asynchronously from either a page or a service worker. Available only in secure contexts.

MDN Reference

Properties

Functions

Link copied to clipboard
inline suspend fun CookieStore.delete(name: String)

The delete() method of the CookieStore interface deletes a cookie that matches the given name or options object. The method expires the cookie by changing its date to one in the past.

inline suspend fun CookieStore.delete(options: CookieStoreDeleteOptions)
Link copied to clipboard

The delete() method of the CookieStore interface deletes a cookie that matches the given name or options object. The method expires the cookie by changing its date to one in the past.

Link copied to clipboard
open fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
inline suspend fun CookieStore.get(): CookieListItem?
inline suspend fun CookieStore.get(options: CookieStoreGetOptions): CookieListItem?

inline suspend fun CookieStore.get(name: String): CookieListItem?

The get() method of the CookieStore interface returns a Promise that resolves to a single cookie matching the given name or options object. The method will return the first cookie that matches.

Link copied to clipboard
inline suspend fun CookieStore.getAll(): CookieList
inline suspend fun CookieStore.getAll(options: CookieStoreGetOptions): CookieList

inline suspend fun CookieStore.getAll(name: String): CookieList

The getAll() method of the CookieStore interface returns a Promise that resolves as an array of cookies that match the name or options passed to it. Passing no parameters will return all cookies for the current context.

Link copied to clipboard

The getAll() method of the CookieStore interface returns a Promise that resolves as an array of cookies that match the name or options passed to it. Passing no parameters will return all cookies for the current context.

fun getAllAsync(options: CookieStoreGetOptions = definedExternally): Promise<CookieList>
Link copied to clipboard

The get() method of the CookieStore interface returns a Promise that resolves to a single cookie matching the given name or options object. The method will return the first cookie that matches.

fun getAsync(options: CookieStoreGetOptions = definedExternally): Promise<CookieListItem?>
Link copied to clipboard
inline suspend fun CookieStore.set(options: CookieInit)

inline suspend fun CookieStore.set(name: String, value: String)

The set() method of the CookieStore interface sets a cookie with the given name and value or options object.

Link copied to clipboard
fun setAsync(options: CookieInit): Promise<Void?>

fun setAsync(name: String, value: String): Promise<Void?>

The set() method of the CookieStore interface sets a cookie with the given name and value or options object.

Link copied to clipboard