I'm working on making a mini browser using a UIWebView
.
I'd like to provide users with a way to remove all cookies from all sites - similar to in the Chrome app where you can clear cache, etc.
What's the best way to accomplish this in a UIWebView
?
Here's one idea I had:
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}
[[NSUserDefaults standardUserDefaults] synchronize];