2

From googling a bit, the answer to my question is "yes". But how do I test that?

I tried to inpsect the HTTP request headers (i.e. [request allHTTPHeaderFields]) in webView:shouldStartLoadWithRequest:navigationType:, but none of the request has the "Cookie" entry, even though cookies are successfully stored in [NSHTTPCookieStorage sharedHTTPCookieStorage].

William Niu
  • 15,798
  • 7
  • 53
  • 93

1 Answers1

4

try this to loop through all the cookies in the UIWebView to verify they are there

NSHTTPCookie *aCookie;
for (aCookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
   NSLog(@"%@", aCookie);
}
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
  • Yes, the cookies are there. I just printed out the array: `NSLog(@"%@", [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies])` – William Niu Dec 06 '10 at 04:32