// creating the URL
NSURL *_server_url = [NSURL URLWithString:@"http://my_computer.local/";];
// creation the cookie
NSHTTPCookie *cook = [NSHTTPCookie cookieWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys:
[_server_url host], NSHTTPCookieDomain,
[_server_url path], NSHTTPCookiePath,
@"MY_COOKIE_NAME", NSHTTPCookieName,
@"MY_COOKIE_VALUE", NSHTTPCookieValue,
nil]];
// Posting the cookie
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cook];
Ref:
http://lists.apple.com/archives/Webkitsdk-dev/2003/Sep/msg00003.html