Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Facebook Login button doesn't change to logout after login

I'm creating a website and I'm using facebook as my authentication. I did this before and it worked back then. However it doesn't function now. I can login and logoff, the button will always stay on "login with facebook".

I added autologoutlink="true", but it still doesn't work. Code below:

<fb:login-button autologoutlink="true" perms="">Login with Facebook</fb:login-button>  

If it helps, this is the rest of my facebook code:

<script src="http://connect.facebook.net/en_US/all.js"></script>  
<script>  
    FB.init({appId:'XXXXXXXXXXX', cookie:true, 
            status:true, xfbml:true
    });   

    // log IN event
    FB.Event.subscribe('auth.login', function(response) {  
        alert("logged in");
        insertMyInfo(response);          
    });

    // log OUT event
    FB.Event.subscribe('auth.logout', function(response) {
        alert("logged off");   
    });                
</script>
like image 457
xrDDDD Avatar asked Dec 17 '25 10:12

xrDDDD


1 Answers

try to get the "Login with Facebook" text out of this

       <fb:login-button autologoutlink="true" perms="">Login with Facebook</fb:login-button>

I mean it should look like this

   <fb:login-button autologoutlink="true" perms=""></fb:login-button>

The text will be automatically completed accordingly to the situation( Login or Logout). I don't know if you still need the answer since it's been a while since you asked the question but ...still, just in case :)

like image 103
Lara Avatar answered Dec 20 '25 00:12

Lara



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!