开发者

Do requests in UIWebView use sharedHTTPCookieStorage?

开发者 https://www.devze.com 2023-01-29 04:22 出处:网络
From googling a bit, the answer to my question is \"yes\". But how do I test that? I trie开发者_运维问答d to inpsect the HTTP request headers (i.e. [request allHTTPHeaderFields]) in webView:shouldSt

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

I trie开发者_运维问答d 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].


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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消