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

# getCookies(for:completionHandler:)

```
func getCookies(for url: URL, completionHandler: @escaping @MainActor @Sendable ([HTTPCookie]) -> Void)
```

```
func cookies(for url: URL) async -> [HTTPCookie]
```

## Parameters

`url`

The URL to fetch the matching cookies for.

`completionHandler`

A block to invoke with the fetched cookies.

## Discussion\abstract Fetches stored cookies that match the passed in URL.

---

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)