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

# getAllCookies(_:)

Fetches all stored cookies asynchronously and delivers them to the specified completion handler.

```
func getAllCookies(_ completionHandler: @escaping @MainActor @Sendable ([HTTPCookie]) -> Void)
```

## Parameters

`completionHandler`

A completion handler block to execute asynchronously with the results. This block has no return value and takes the following parameter:

- cookieArray: An array of <doc://com.apple.documentation/documentation/Foundation/HTTPCookie> objects. If the store contains no cookies, this parameter contains an empty array.

## Discussion

Use this method to get the set of cookies currently associated with your web view. Iterate over the contents of the provided array to retrieve the specific cookie you need for your code.

---

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)