Home:ALL Converter>Facebook:logout function does not log user out

Facebook:logout function does not log user out

Ask Time:2013-08-27T12:24:27         Author:Manu

Json Formatter

I am working with an IOS PhoneGap application. I integrated the app with FB and I successfully logged in.

I use the following code for the login:

function login() {

FB.login(
     function(response) {
     if (response.session) {
     console.log('logged in');

     } else {
     console.log('not logged in');

     FB.getLoginStatus(function(response) {
                   if (response.status == 'connected') {

                   alert("user logged");                                             
                   }
                                   else {
                   console.log('not logged in  get loginstatus');
                   }
                   });                               
     }
     },
     { scope: "email" }
     );
}

My problem is that I am not able to log the user out from my application and from the FB. The logout function is not logging the user out.

I am using the following code :

function facebooklogout() {
    FB.logout(function (response) {
    alert("logged out");
    });
}

How can I fix this problem?

Thanks...

Author:Manu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18456915/facebooklogout-function-does-not-log-user-out
yy