I'm attempting to log a user out of facebook with the Facebook JS SDK, however calling:
FB.logout(function(response){
console.log(response);
});
returns: response.status == "connected"
And only after refreshing the page does the SDK realize that the session has ended. Anyone know what could be causing this behavior? This code previously worked in my application and has recently started behaving this way.
Another example using FireBug:
https://developers.facebook.com/bugs/245362365535898?browse=search_4f112135664703a96454690
This is a bug in the JS SDK that has now been fixed and it should get pushed in not too long.
Until then you can do the following
FB.logout(function(response) {
FB.Auth.setAuthResponse(null, 'unknown');
...
});
See http://hustoknow.blogspot.com/2012/01/dealing-with-zombie-facebook-cookies.html
When you logout, a cross-domain request gets sent to Facebook to invalidate the session. When you hit reload, another request gets sent to Facebook's site -- since FB recognizes the cookie as invalid, it correctly deletes the cookie from your browser.
I suspect it's a regexp bug in how they forgot to parse the fbm_ cookie, recently introduced in the last day or so. I'm just surprised that this fix hasn't been pushed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With