我正在使用UIWebView加载URL。我想知道如何清除那里的Cookies。
答案 0 :(得分:15)
您可以浏览cookie jar中的每个cookie并将其删除。
How to delete all cookies of UIWebView?
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}
答案 1 :(得分:1)
NSHTTPCookie *cooki;
NSHTTPCookieStorage *data = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cooki in [data cookies]) {
[data deleteCookie:cooki];
}