---
title: httpCookieStorage
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionconfiguration/httpcookiestorage
---

# httpCookieStorage

The cookie store for storing cookies within this session.

## Declaration

```swift
var httpCookieStorage: HTTPCookieStorage? { get set }
```

## Discussion

Discussion This property determines the cookie storage object used by all tasks within sessions based on this configuration. To disable cookie storage, set this property to nil. For default and background sessions, the default value is the shared cookie storage object. For ephemeral sessions, the default value is a private cookie storage object that stores data in memory only, and is destroyed when you invalidate the session.

## See Also

### Setting cookie policies

- [httpCookieAcceptPolicy](foundation/urlsessionconfiguration/httpcookieacceptpolicy.md)
- [httpShouldSetCookies](foundation/urlsessionconfiguration/httpshouldsetcookies.md)
- [HTTPCookie](foundation/httpcookie.md)
