---
title: "getCookiePolicy(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkhttpcookiestore/getcookiepolicy(_:)"
---

# getCookiePolicy(_:)

Returns a cookie policy that indicates whether the cookie store allows cookie storage.

## Declaration

```swift
func getCookiePolicy(_ completionHandler: @escaping @MainActor @Sendable (WKHTTPCookieStore.CookiePolicy) -> Void)
```

```swift
var cookiePolicy: WKHTTPCookieStore.CookiePolicy { get async }
```

## Parameters

- `completionHandler`: The completion handler block to execute asynchronously with the cookie policy. This block has no return value, and takes the following parameter:

## See Also

### Permitting cookie storage

- [setCookiePolicy(_:completionHandler:)](webkit/wkhttpcookiestore/setcookiepolicy(_:completionhandler:).md)
- [WKHTTPCookieStore.CookiePolicy](webkit/wkhttpcookiestore/cookiepolicy.md)
