Created
October 12, 2012 07:24
-
-
Save kosso/3877780 to your computer and use it in GitHub Desktop.
Making sure people log out of web-authed apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)clearWebViewCookies:(NSMutableArray*)cleardomain | |
{ | |
NSLog(@"[INFO] called webView clearWebViewCache to clear : %@", [cleardomain objectAtIndex:0]); | |
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) { | |
//NSLog(@"[INFO] cookie for : %@",[cookie domain]); | |
if([[cookie domain] isEqualToString:[cleardomain objectAtIndex:0]]) { | |
//NSLog(@"[INFO] deleting cookie for : %@",[cookie domain]); | |
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; | |
} | |
} | |
} | |
- (void)emptyCache | |
{ | |
[[NSURLCache sharedURLCache] removeAllCachedResponses]; | |
NSLog(@"[INFO] nuking the webView cache"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment