Package io.ktor.client.plugins.cookies

Types

Link copied to clipboard
class AcceptAllCookiesStorage : CookiesStorage

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

Link copied to clipboard
class ConstantCookiesStorage(cookies: Cookie) : CookiesStorage

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

Link copied to clipboard
interface CookiesStorage : Closeable

A storage for Cookie.

Link copied to clipboard
class HttpCookies : Closeable

A plugin that allows you to keep cookies between calls in a storage. By default, it uses an in-memory storage, but you can also implement a persistent storage using CookiesStorage.

Functions

Link copied to clipboard
suspend fun CookiesStorage.addCookie(urlString: String, cookie: Cookie)

Adds a cookie with the urlString key to storage.

Link copied to clipboard
suspend fun HttpClient.cookies(url: Url): List<Cookie>

Gets all the cookies for the specified url for this HttpClient.

suspend fun HttpClient.cookies(urlString: String): List<Cookie>

Gets all the cookies for the specified urlString for this HttpClient.

Link copied to clipboard
operator fun List<Cookie>.get(name: String): Cookie?

Gets the specified Cookie by its name.