---
title: httpShouldSetCookies
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionconfiguration/httpshouldsetcookies
---

# httpShouldSetCookies

A Boolean value that determines whether requests should contain cookies from the cookie store.

## Declaration

```swift
var httpShouldSetCookies: Bool { get set }
```

## Discussion

Discussion This property controls whether tasks within sessions based on this configuration should automatically provide cookies from the shared cookie store when making requests. If you want to provide cookies yourself, set this value to false and provide a Cookie header either through the session’s httpAdditionalHeaders property or on a per-request level using a custom NSURLRequest object. The default value is true.

## See Also

### Setting cookie policies

- [httpCookieAcceptPolicy](foundation/urlsessionconfiguration/httpcookieacceptpolicy.md)
- [httpCookieStorage](foundation/urlsessionconfiguration/httpcookiestorage.md)
- [HTTPCookie](foundation/httpcookie.md)
