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.
精彩评论