<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionConfiguration/httpCookieStorage",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLSessionConfiguration(py)HTTPCookieStorage"
  },
  "title" : "httpCookieStorage"
}
-->

# httpCookieStorage

The cookie store for storing cookies within this session.

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

## 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`](/documentation/Foundation/HTTPCookieStorage/shared) cookie storage object.

For [`ephemeral`](/documentation/Foundation/URLSessionConfiguration/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.

---

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)