ktor-client-core / io.ktor.client.features.cookies / CookiesStorage

CookiesStorage

interface CookiesStorage

Storage for Cookie.

Functions

addCookie

abstract suspend fun addCookie(requestUrl: Url, cookie: Cookie): Unit

Sets a cookie for the specified host.

get

abstract suspend fun get(requestUrl: Url): List<Cookie>

Gets a map of String to Cookie for a specific host.

Extension Functions

addCookie

suspend fun CookiesStorage.addCookie(urlString: String, cookie: Cookie): Unit

Add cookie with key urlString to storage.

Inheritors

AcceptAllCookiesStorage

class AcceptAllCookiesStorage : CookiesStorage

CookiesStorage that stores all the cookies in an in-memory map.

ConstantCookiesStorage

class ConstantCookiesStorage : CookiesStorage

CookiesStorage that ignores addCookie and returns a list of specified cookies when constructed.