FB.logout() called without an access token

前端 未结 6 1820
谎友^
谎友^ 2020-11-29 03:10

I\'m trying to log out of a website i\'ve created with Facebook integrated. Logging in works fine, but when I want to log out Firebug consistently gives me this error:

6条回答
  •  星月不相逢
    2020-11-29 03:50

    I went for the less trivial solution:

        function facebookLogout(){
            FB.getLoginStatus(function(response) {
                if (response.status === 'connected') {
                    FB.logout(function(response) {
                        // this part just clears the $_SESSION var
                        // replace with your own code
                        $.post("/logout").done(function() {
                            $('#status').html('

    Logged out.

    '); }); }); } }); }

提交回复
热议问题