Instance Property

HTTPCookieAcceptPolicy

A policy constant that determines when cookies should be accepted.

Declaration

@property NSHTTPCookieAcceptPolicy HTTPCookieAcceptPolicy;

Discussion

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

HTTPShouldSetCookies

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

HTTPCookieStorage

The cookie store for storing cookies within this session.

NSHTTPCookieStorage

A container that manages the storage of cookies.

NSHTTPCookie

A representation of an HTTP cookie.