@smoothdvd , I have similar case, I can't get cookie in funtion:
(void)applyCookieHeader
{
// Add cookies from the persistent (mac os global) store
if ([self useCookiePersistence]) {
// NSArray * cookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[(NSHTTPURLResponse )response allHeaderFields] forURL:[[self url] absoluteURL]];
NSArray cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[[self url] absoluteURL]];
if (cookies) {
[[self requestCookies] addObjectsFromArray:cookies];
}
}
......
}
cookies will return blank.
But worked in real device(iPhone 5c). I test this with xcode 6.0.1.