Contents

cookieWithProperties:

Creates and initializes an HTTP cookie object using the provided properties.

Declaration

+ (NSHTTPCookie *) cookieWithProperties:(NSDictionary<NSString *,id> *) properties;

Parameters

  • properties:

    The properties for the new cookie object, expressed as key value pairs.

Return Value

The newly created cookie object. Returns nil if the provided properties are invalid.

Discussion

To successfully create a cookie, you must provide values for (at least) the path, name, and value keys, and either the originURL key or the domain key.

See Accepting cookies for more information on the available cookie attribute constants and the constraints imposed on the values in the dictionary.

See Also

Creating cookies