IOS 清除UIWebview的缓存以及cookie

NSLog(@"清除cookies");
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in [storage cookies]) {
    [storage deleteCookie:cookie];
}

NSLog(@"清除UIWebView的缓存");
[[NSURLCache sharedURLCache] removeAllCachedResponses];

你可能感兴趣的:(ios,UIWebView,缓存,cookie)