简体   繁体   中英

fb:login-button Problems

I'm having troubles with the login tag "fb:login-button". If I login works fine, but if I logout it doesn't really logout I have to refresh the page to be completly logged out

This is the code I use, maybe it can help you. Take a look at the events I subscribe to. After login/logout, it refreshes the page automatically:

window.fbAsyncInit = function() {
    FB.init({
      appId: '<?php echo $facebook->getAppID() ?>', 
      cookie: true, 
      xfbml: true,
      oauth: true
    });

    FB.Event.subscribe('auth.login', function(response) {
        window.location.reload();
    });

    FB.Event.subscribe('auth.logout', function(response) {
        window.location.reload();
    });
  };

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM