Skip to content

Instantly share code, notes, and snippets.

@rubdottocom
Created May 17, 2012 18:43
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rubdottocom/2720834 to your computer and use it in GitHub Desktop.
Save rubdottocom/2720834 to your computer and use it in GitHub Desktop.
Objective-C: Clean Cache and Cookie from UIWebView
//Set Cache
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
//Clear All Cookies
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
}
@rubdottocom
Copy link
Author

Add this code to viewDidLoad

@stallion502
Copy link

rubdoftocom, ADD THIS TO viewDidLoad.
Thank you very much. Love from Russia!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment