Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Problem with NSCookies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSCookies



Hello,

	I found a problem in  [NSHTTPCookie cookieWithProperties: ...].

1/ Creating with NSHTTPCookieOriginURL and an NSURL seems bogus and it generate an error :
*** -[NSURL _web_stringByTrimmingWhitespace]: selector not recognized
2/ The NSHTTPCookiePath property is noted as Optional in the doc, but i was not able to create a cookie without it.



My success code is :

// 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];




Regards

Xavier
_______________________________________________
webkitsdk-dev mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/webkitsdk-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Problem with NSCookies (From: Xavier Pechoultres <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.