Skip to content

Instantly share code, notes, and snippets.

@priore
Created October 25, 2013 23:44
Show Gist options
  • Save priore/7163524 to your computer and use it in GitHub Desktop.
Save priore/7163524 to your computer and use it in GitHub Desktop.
Force Facebook Logout
// force close
[[FBSession activeSession] closeAndClearTokenInformation];
[[FBSession activeSession] close];
[FBSession setActiveSession:nil];
// remove FB cookie
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in [storage cookies]) {
NSString *domainName = [cookie domain];
NSRange domainRange = [domainName rangeOfString:@"facebook"];
if(domainRange.length > 0) {
[storage deleteCookie:cookie];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment