开发者

facebook log out

开发者 https://www.devze.com 2023-03-01 06:34 出处:网络
i have made one site in which ihave given functionality called \'connect with facebook\'. it works fine for login..

i have made one site in which i have given functionality called 'connect with facebook'. it works fine for login..

but now i want to implement functionality when i click on logout, it s开发者_高级运维hould be logged out from facebook as well...

can any one tell me from where i should start..?


When you implement facebook logout using FB.logout, make sure its not redirecting before completing the logout action. I have done something like this.

$('#logout-link').click(function(){
        var loc = $(this).attr('href')
        FB.logout(function(response){
                location.href = loc;
        })
        return false;
})


FB Logout says that calling FB.logout will log out the user.


Use <fb:login-button perms='email' autologoutlink='true'></fb:login-button>. And then capture the logout event and simply redirect user to some where you can also logout from your system. When user will click the fb:logout you can capture that event at this function

FB.Event.subscribe("auth.logout", function(response)
 {
  // redirect user to that page where you logout from your system
  });
simple ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号