A Boolean value that determines whether requests should contain cookies from the cookie store.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
var httpShouldSetCookies: Bool { get set }
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 http
property or on a per-request level using a custom NSURLRequest
object.
The default value is true
.