开发者

Best practices with Facebook Connect logout?

开发者 https://www.devze.com 2023-01-19 19:54 出处:网络
I\'m building a web app with Django using Facebook authentication. Now I have encountered a problem with the logout.开发者_如何学JAVA

I'm building a web app with Django using Facebook authentication.

Now I have encountered a problem with the logout.开发者_如何学JAVA

Do developers usually hide the default logout link?

It is quite tricky coming up with the logic of implementing a logout while a user is connected to a facebook acount, which is still logged in.


Any ideas?


The Facebook Connect login is interconnected to the regular Facebook site login. This means that if you log in to a Facebook Connect site, you also log in on facebook.com. And as soon as you log out of facebook.com, you're also logged out of the Facebook Connect site.

Implementing your own logout on your Facebook Connect site is very simple. I use the JavaScript SDK and here's how it's done there:

FB.logout(function(response) {
  // user is now logged out
});

(http://developers.facebook.com/docs/reference/javascript/FB.logout)

I'm not sure if this was the answer to your question(?)

/Thomas Kahn


I also like the

FB.connect.logout( function(response) {
    // Handle response. 
});

approach. It's kinda intrusive for other apps, but it does have the advantage of really cleaning for real.

0

精彩评论

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