<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKHTTPCookieStore/getCookiePolicy(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKHTTPCookieStore(im)getCookiePolicy:"
  },
  "title" : "getCookiePolicy(_:)"
}
-->

# getCookiePolicy(_:)

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

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

## Parameters

`completionHandler`

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

- cookiePolicy: A [`WKHTTPCookieStore.CookiePolicy`](/documentation/WebKit/WKHTTPCookieStore/CookiePolicy) case that indicates whether the cookie store allows cookie storage.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)