Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook doesn't logout completely-ios

while i was trying to integrate fbsdk(facebook) to my app ,it's login session working perfectly.But while i log out from mp app,it does show log out actionsheet and i can logout it easily.But when i try to login again to the facebook it goes directly to the facebook confirmation page instead of going to the login page details.Hope your help.

enter image description here

codes i used for logout.

  FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
            [FBSDKAccessToken setCurrentAccessToken:nil];
            [FBSession.activeSession closeAndClearTokenInformation];

            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];
                }
            }
            [manager logOut];
like image 936
Abdul Nouzil Avatar asked Dec 13 '25 17:12

Abdul Nouzil


1 Answers

It dsnt happen coz facebook login is done by either Safari OR facebook app (If facebook app is installed in your phone and you have added it in settings account).

This is because, Safari holds facebook session and keeps it as cookies. And in case of Facebook app, if it is connected to settings accounts, it will continue to hold the session untill you logout manually. Logging out manually from safari or facebook app or clearing cookies of safari is the only way to logout from facebook if it is already logged in.

like image 194
Saheb Roy Avatar answered Dec 16 '25 06:12

Saheb Roy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!