# CookieManagerCompat

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/CookieManagerCompat.java+class:androidx.webkit.CookieManagerCompat) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

*** ** * ** ***


```
@AnyThread
class CookieManagerCompat
```

<br />

*** ** * ** ***

Compatibility version of `https://developer.android.com/reference/android/webkit/CookieManager.html`

## Summary

| ### Public functions |
|---|---|
| `java-static (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature.GET_COOKIE_INFO, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/webkit/CookieManagerCompat#getCookieInfo(android.webkit.CookieManager,java.lang.String)(cookieManager: https://developer.android.com/reference/android/webkit/CookieManager.html, url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Gets all the cookies for the given URL along with their set attributes. |

## Public functions

### getCookieInfo

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.6.0)

```
@RequiresFeature(name = WebViewFeature.GET_COOKIE_INFO, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
java-static fun getCookieInfo(cookieManager: CookieManager, url: String): (Mutable)List<String!>
```

Gets all the cookies for the given URL along with their set attributes. The cookies are returned in the format of the HTTP 'Set-Cookie' header as defined in [the RFC6265 spec.](https://httpwg.org/specs/rfc6265.html#sane-set-cookie-syntax) eg. "name=value; domain=.example.com; path=/"

| Parameters |
|---|---|
| `cookieManager: https://developer.android.com/reference/android/webkit/CookieManager.html` | The CookieManager instance to get info from. |
| `url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the URL for which the API retrieves all available cookies. |

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | the cookies as a list of strings. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | if the `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#GET_COOKIE_INFO()` feature is not supported. This should be checked before use with `https://developer.android.com/reference/kotlin/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String)`. |