Instance Property


A policy constant that determines when cookies should be accepted.


@property NSHTTPCookieAcceptPolicy HTTPCookieAcceptPolicy;


This property determines the cookie accept policy for all tasks within sessions based on this configuration.

The default value is NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain. You can change it to any of the constants defined in the NSHTTPCookieAcceptPolicy enumerated type.

If you want more direct control over what cookies are accepted, set this value to NSHTTPCookieAcceptPolicyNever and then use the allHeaderFields and cookiesWithResponseHeaderFields:forURL: methods to extract cookies from the URL response object yourself.

See Also

Setting Cookie Policies


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


The cookie store for storing cookies within this session.


A container that manages the storage of cookies.


A representation of an HTTP cookie.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software