Instance Method

storeCookies:forTask:

Stores an array of cookies in the cookie storage, on behalf of the provided task, if the cookie accept policy permits.

Declaration

- (void)storeCookies:(NSArray<NSHTTPCookie *> *)cookies forTask:(NSURLSessionTask *)task;

Parameters

cookies

The cookies to add.

task

The task that handles the response. Override this method and inspect this parameter if you need to alter your cookie storage strategy based on properties of the task.

See Also

Adding and Removing Cookies

- removeCookiesSinceDate:

Removes cookies that were stored after a given date.

- deleteCookie:

Deletes the specified cookie from the cookie storage.

- setCookie:

Stores a specified cookie in the cookie storage if the cookie accept policy permits.

- setCookies:forURL:mainDocumentURL:

Adds an array of cookies to the cookie storage if the storage’s cookie acceptance policy permits.