ASIHTTPRequest with Cookie

来源:互联网 发布:电路cam程序软件 编辑:程序博客网 时间:2024/05/16 11:17
// creating the URLNSURL *_server_url = [NSURL URLWithString:@"http://my_computer.local/";];// creation the cookieNSHTTPCookie *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