---
title: WKWebsiteDataStore
framework: webkit
role: symbol
role_heading: Class
path: webkit/wkwebsitedatastore
---

# WKWebsiteDataStore

An object that manages cookies, disk and memory caches, and other types of data for a web view.

## Declaration

```swift
@MainActor class WKWebsiteDataStore
```

## Overview

Overview Use a WKWebsiteDataStore object to configure and manage web site data. Specifically, use this object to: Manage cookies that your web site uses Learn about the types of data that websites store Remove unwanted web site data Create a data store object and assign it to the websiteDataStore property of a WKWebViewConfiguration object before you create your web view. By default, WKWebViewConfiguration uses the default data store returned by the default() method, which saves website data persistently to disk. To implement private browsing, create a nonpersistent data store using the nonPersistent() method instead. To implement profile browsing, create a persistent data store using the init(forIdentifier:) method, passing an identifier that you use to identify the data store.

## Topics

### Creating a data store object

- [default()](webkit/wkwebsitedatastore/default().md)
- [nonPersistent()](webkit/wkwebsitedatastore/nonpersistent().md)
- [init(forIdentifier:)](webkit/wkwebsitedatastore/init(foridentifier:).md)

### Finding data stores

- [fetchAllDataStoreIdentifiers(_:)](webkit/wkwebsitedatastore/fetchalldatastoreidentifiers(_:).md)

### Inspecting data store properties

- [identifier](webkit/wkwebsitedatastore/identifier.md)
- [isPersistent](webkit/wkwebsitedatastore/ispersistent.md)

### Retrieving a cookie store

- [httpCookieStore](webkit/wkwebsitedatastore/httpcookiestore.md)

### Retrieving specific types of data

- [fetchDataRecords(ofTypes:completionHandler:)](webkit/wkwebsitedatastore/fetchdatarecords(oftypes:completionhandler:).md)
- [allWebsiteDataTypes()](webkit/wkwebsitedatastore/allwebsitedatatypes().md)

### Removing specific types of data

- [removeData(ofTypes:for:completionHandler:)](webkit/wkwebsitedatastore/removedata(oftypes:for:completionhandler:).md)
- [removeData(ofTypes:modifiedSince:completionHandler:)](webkit/wkwebsitedatastore/removedata(oftypes:modifiedsince:completionhandler:).md)

### Removing a data store

- [remove(forIdentifier:completionHandler:)](webkit/wkwebsitedatastore/remove(foridentifier:completionhandler:).md)

### Initializers

- [init(coder:)](webkit/wkwebsitedatastore/init(coder:).md)

### Instance Properties

- [proxyConfigurations](webkit/wkwebsitedatastore/proxyconfigurations-cdc1.md)

### Instance Methods

- [fetchData(of:completionHandler:)](webkit/wkwebsitedatastore/fetchdata(of:completionhandler:).md)
- [restoreData(_:completionHandler:)](webkit/wkwebsitedatastore/restoredata(_: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)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)

## See Also

### Web data management

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