清除cookie
+ (void)clearCookie:(NSString*)domain
{
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in [storage cookies]) {
if ([cookie.domain rangeOfString:domain].location != NSNotFound) {
[storage deleteCookie:cookie];
}
}
[[NSUserDefaults standardUserDefaults] synchronize];
}
网友评论