Cookies

This feature keeps cookies between calls or forces specific cookies.

This feature is defined in the method io.ktor.client.features.cookies and no additional artifacts are required.

Installation

1. val client = HttpClient() {
2. install(HttpCookies) {
3. // Will keep an in-memory map with all the cookies from previous requests.
4. storage = AcceptAllCookiesStorage()

6. // Will ignore Set-Cookie and will send the specified cookies.
7. storage = ConstantCookieStorage(Cookie("mycookie1", "value"), Cookie("mycookie2", "value"))
8. }
9. }

11. client.cookies("mydomain.com")