<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKHTTPCookieStore"
  },
  "title" : "WKHTTPCookieStore"
}
-->

# WKHTTPCookieStore

An object that manages the HTTP cookies associated with a particular web view.

```
@MainActor class WKHTTPCookieStore
```

## Overview

Use a [`WKHTTPCookieStore`](/documentation/WebKit/WKHTTPCookieStore) to specify the initial cookies for your webpages, and to manage cookies for your web content. For example, you might use this object to delete the cookie for the current session when the user logs out. To detect when the webpage changes a cookie, install a cookie observer using the [`add(_:)`](/documentation/WebKit/WKHTTPCookieStore/add(_:)) method.

You don’t create a [`WKHTTPCookieStore`](/documentation/WebKit/WKHTTPCookieStore) object directly. Instead, retrieve this object from the [`WKWebsiteDataStore`](/documentation/WebKit/WKWebsiteDataStore) object in your web view’s configuration object.

## Topics

### Managing cookies

[`getAllCookies(_:)`](/documentation/WebKit/WKHTTPCookieStore/getAllCookies(_:))

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

[`setCookie(_:completionHandler:)`](/documentation/WebKit/WKHTTPCookieStore/setCookie(_:completionHandler:))

Adds a cookie to the cookie store.

[`delete(_:completionHandler:)`](/documentation/WebKit/WKHTTPCookieStore/delete(_:completionHandler:))

Deletes the specified cookie.

### Permitting cookie storage

[`getCookiePolicy(_:)`](/documentation/WebKit/WKHTTPCookieStore/getCookiePolicy(_:))

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

[`setCookiePolicy(_:completionHandler:)`](/documentation/WebKit/WKHTTPCookieStore/setCookiePolicy(_:completionHandler:))

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

[`WKHTTPCookieStore.CookiePolicy`](/documentation/WebKit/WKHTTPCookieStore/CookiePolicy)

An enumeration with cases that indicate whether a cookie store allows cookie storage.

### Observing cookie store changes

[`add(_:)`](/documentation/WebKit/WKHTTPCookieStore/add(_:))

Adds an observer to the cookie store.

[`remove(_:)`](/documentation/WebKit/WKHTTPCookieStore/remove(_:))

Removes an observer from the cookie store.

[`WKHTTPCookieStoreObserver`](/documentation/WebKit/WKHTTPCookieStoreObserver)

The methods to adopt in an object that monitors changes to a webpage’s cookies.



---

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)