I am working on my application here, and it pretty much comes to this. I have a login window in which users are logged in, and then it saves the cookie when returning like this:
NSArray * all = [NSHTTPCookie cookiesWithResponseHeaderFields:[resp allHeaderFields] forURL:[NSURL URLWithString:@"http://myurl]]; NSHTTPCookieStorage *sharedHTTPCookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; [sharedHTTPCookieStorage setCookies:all forURL:[NSURL URLWithString:@"http:
After he protects this cookie, I will take it to my home vision. My problem is that if users close prgoram, the phone restarts, etc. - are cookies stored locally on the phone sefl? I am trying to access this cookie again on didFinishLaunchingWithOptions. Now I have the following code.
NSHTTPCookieStorage *sharedHTTPCookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSArray *cookies = [sharedHTTPCookieStorage cookiesForURL:[NSURL URLWithString:@"http://iphone.wazgood.com"]]; NSLog(@"count: %i", [cookies count]);
Each time - it becomes empty in the cookie data - any ideas on whether the cookies are cleared every time the user pushes the program, or is it testing bc im on the iPhone emulator?
object objective-c iphone
Adam Flatau Jan 07 2018-11-11T00: 00Z
source share