I\'m trying to send an authentication string via cookie in a NSMutableURLRequest. I\'m trying to create the NSHTTPCookie through
+(id)cookieWithProperties:(
This is how you set properties in a cookie:
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:
url, NSHTTPCookieOriginURL,
@"testCookies", NSHTTPCookieName,
@"1", NSHTTPCookieValue,
nil];
NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:properties];
In the example above:
url
, testCookies
, and 1
are the values. Likewise, NSHTTPCookieOriginURL
, NSHTTPCookieName
, NSHTTPCookieValue
are the keys for the NSDictionary
object, as in key-value pairs.
You set/get properties using NSDictionary
and add to NSHTTPCookie
.