I am running a Post call to a URL and logging into a system. This is working, but after the login, I am attempting to retrieve the cookies – but when I do this:
NSArray *allCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[response allHeaderFields] forURL:[NSURL URLWithString:mywebsite"]];
NSLog(@"How many Cookies: %d", allCookies.count);
I am getting a response of “How many Cookies: 0”
The problem is that when I close the App and then reopen, it is connecting using the info from my previous login.
What is going on here? Why is it telling me there are zero cookies? How can I get rid of these cookies?