Facebook Connect Logout not working (Wordpress FBConnect plugin)

If you are having troubles with the Logout function of Facebook Connect using the wp-fbconnect plugin for Wordpress. Head into the wp-fbconnect plugin folder, open up fbconnect.js and modify the following code (add the code in red):

logout : function() {
FB.ensureInit(function() {
FB.Connect.logout();
setTimeout(function () {
window.location = FBConnect.home_url;
}, 3000);

});
},

I have tried a couple of numbers for the delay and 3 secs seems to be rather reliable for now. You might find other numbers more suitable for yourself. I have no explanation for this behavior currently. A wild guess might be when the logout is called, there is a delay between the data being updated and synchronised across the Facebook servers, hence when the page refreshes too fast, the user is read as being still logged in and FB resets his status to being connected. If you know whats going on, please contact me via the comments below. Thanks and Cheers.

4 Responses to “Facebook Connect Logout not working (Wordpress FBConnect plugin)”


  • Awesome, fixed my problem. Thanks!

  • Tried this and didnt work, but I am using the Buddypress FB-connect, not sure if it makes a difference?

  • I use the current buddypress version (1.2) and the bp-fb-connect plugin for buddypress. There is also a fbconnect.js with exactly the same code. I add the red code you mentioned but unfortunately nothing changed. George, could you solve the problem meanwhile?

    If yes, could you please tell me how?

  • I can only log out from the backend. From the admin-backend area it works but not from the frontpage. Strange.

Leave a Reply