---
title: WKHTTPCookieStore
framework: webkit
role: symbol
role_heading: Class
path: webkit/wkhttpcookiestore
---

# WKHTTPCookieStore

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

## Declaration

```swift
@MainActor class WKHTTPCookieStore
```

## Overview

Overview Use a 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(_:) method. You don’t create a WKHTTPCookieStore object directly. Instead, retrieve this object from the WKWebsiteDataStore object in your web view’s configuration object.

## Topics

### Managing cookies

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

### Permitting cookie storage

- [getCookiePolicy(_:)](webkit/wkhttpcookiestore/getcookiepolicy(_:).md)
- [setCookiePolicy(_:completionHandler:)](webkit/wkhttpcookiestore/setcookiepolicy(_:completionhandler:).md)
- [WKHTTPCookieStore.CookiePolicy](webkit/wkhttpcookiestore/cookiepolicy.md)

### Observing cookie store changes

- [add(_:)](webkit/wkhttpcookiestore/add(_:).md)
- [remove(_:)](webkit/wkhttpcookiestore/remove(_:).md)
- [WKHTTPCookieStoreObserver](webkit/wkhttpcookiestoreobserver.md)

### Instance Methods

- [getCookies(for:completionHandler:)](webkit/wkhttpcookiestore/getcookies(for:completionhandler:).md)
- [setCookies(_:completionHandler:)](webkit/wkhttpcookiestore/setcookies(_:completionhandler:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Web data management

- [WKWebsiteDataStore](webkit/wkwebsitedatastore.md)
- [WKWebsiteDataRecord](webkit/wkwebsitedatarecord.md)
- [WKURLSchemeHandler](webkit/wkurlschemehandler.md)
- [WKURLSchemeTask](webkit/wkurlschemetask.md)
- [readAccessURL](foundation/nsattributedstring/documentreadingoptionkey/readaccessurl.md)
