SHARE
TWEET

Force Facebook Logout

priore May 20th, 2013 655 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // force close
  2.     [[FBSession activeSession] closeAndClearTokenInformation];
  3.     [[FBSession activeSession] close];
  4.     [FBSession setActiveSession:nil];
  5.    
  6.     // remove FB cookie
  7.     NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
  8.     for (NSHTTPCookie *cookie in [storage cookies]) {
  9.         NSString *domainName = [cookie domain];
  10.         NSRange domainRange = [domainName rangeOfString:@"facebook"];
  11.         if(domainRange.length > 0) {
  12.             [storage deleteCookie:cookie];
  13.         }
  14.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top