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

# getAllCookies(_:)

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

## Declaration

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

```swift
func allCookies() async -> [HTTPCookie]
```

## Parameters

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

## Discussion

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.

## See Also

### Managing cookies

- [setCookie(_:completionHandler:)](webkit/wkhttpcookiestore/setcookie(_:completionhandler:).md)
- [delete(_:completionHandler:)](webkit/wkhttpcookiestore/delete(_:completionhandler:).md)
