NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSArray *cookies = [storage cookiesForURL:[NSURL URLWithString:@"http://www.facebook.com/"]];
NSLog(@"old cookies!: %@",cookies);
NSHTTPCookie *cookie;
for (cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}
NSLog(@"new cookies!: %@",cookies);
I am trying to delete the facebook cookie in a logout function but no cookies are deleted. I do not understand why. Any help will be greatly appreciated.