iOS - Facebook Connect logout not deleting login details?

后端 未结 4 2301
忘掉有多难
忘掉有多难 2020-12-05 16:49

I have used Facebook Connect on another project with relatively few problems, however on my current project it seems that when I call [facebook logout]; it does

相关标签:
4条回答
  • 2020-12-05 17:04

    Note: as well as FB app stores login information in NSUserDefaults it also stores login information in NSHTTPCookieStorage using name m_user. You can just remove this record to cause FB ask you login information again.

    Hope this information will help you.

    0 讨论(0)
  • 2020-12-05 17:08

    [appDelegate.session closeAndClearTokenInformation];

    just that line of code, helped me clear my tokens.

    0 讨论(0)
  • 2020-12-05 17:15

    You provide this method when user clicks on logout and remove all keys stored in userdefault for facebook

    - (void)fbDidLogout
    {
      NSLog(@"Logged out of facebook");
      NSHTTPCookie *cookie;
       NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
       for (cookie in [storage cookies])
       {
           NSString* domainName = [cookie domain];
           NSRange domainRange = [domainName rangeOfString:@"facebook"];
           if(domainRange.length > 0)
           {
               [storage deleteCookie:cookie];
           }
       }
    }
    
    0 讨论(0)
  • 2020-12-05 17:20
     [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"FBAccessTokenKey"];
    
    [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"FBExpirationDateKey"];
    
    0 讨论(0)
提交回复
热议问题