views:

206

answers:

1

For some reason when I call FB.logout();, the user does not actually get logged out of Facebook.

Why might this be? No js errors get thrown, and I can step through the code as it runs through the SDK... it just doesn't successfully log out.

+1  A: 

You need to have the fb-root DIV tag first, then call FB.init() and then FB.logout()

Example Usage:

FB.logout(function(){
  window.location = 'path/url here';
});

Alternatively, you should redirect to this url logout:

www.facebook.com/logout.php?app_key=KEY&session_key=SESSION&next=REDIRECT_URL
Sarfraz
Thank you thank you. I had removed the fb-root as part of the post login js function. Didn't know I still needed it.
Josiah Kiehl

related questions