I’m trying to send an authentication string via cookie in a NSMutableURLRequest. I’m trying to create the NSHTTPCookie through
+(id)cookieWithProperties:(NSDictionary *)properties
But nowhere have I been able to find how to specify the properties other than the simple key-value pair I have for authentication. When I only use my key-value pair, nil is returned.
Any examples, documentation, or thoughts on this would be greatly appreciated.
This is how you set properties in a cookie:
In the example above:
url,testCookies, and1are the values. Likewise,NSHTTPCookieOriginURL,NSHTTPCookieName,NSHTTPCookieValueare the keys for theNSDictionaryobject, as in key-value pairs.You set/get properties using
NSDictionaryand add toNSHTTPCookie.