Ktor 1.6.8 Help

Cookies

This plugin (previously known as feature) keeps cookies between calls or forces specific cookies.

Installation

val client = HttpClient() { install(HttpCookies) { // Will keep an in-memory map with all the cookies from previous requests. storage = AcceptAllCookiesStorage() // Will ignore Set-Cookie and will send the specified cookies. storage = ConstantCookiesStorage(Cookie("mycookie1", "value"), Cookie("mycookie2", "value")) } } client.cookies("mydomain.com")
Last modified: 03 June 2021