Original Question: Facebook logout URL not working 2014??
Well I tried to logout, a user from facebook using url but isn't working, I used this URL:
https://www.facebook.com/logout.php?confirm=1&next=http://www.foo.com&access_token=XX
Answer: The problem why url wasn't working is that access_token=xxxx**&expiresIn=123** , the expiresIn parameter tagging along was the main reason why the URL wasn't working, but I ended up using the JS SDK anyway. But still I am having problems can anyone help me with the updated issue I have mentioned below.
I have a situation where I can't use the javascript alternative. As I haven't been using Javascript SDK to login users to begin with. The application I am building is in Scala, so I haven't any SDK, just urls.
@Update: Well I solved my problem of logging out people using my app, by using the facebook javascript SDK, it just loads the sdk and calls the logout api, code snippet below.
But Still I am having problems, i.e if users login to my app using their facebook account but then don't give permission to my FB app at the permission dialog then there will be an active facebook session running and no way to clear it or log him/her out (i am building a KIOSK APP so it will be a deadlock condition).
I can't log them out using the Logout API, so how do I clear the session. I checked various SO posts to clear session cookies but none seem to work.
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxx',
cookie : true, // enable cookies to allow the server to access
// the session
xfbml : true, // parse social plugins on this page
version : 'v2.1' // use version 2.1
});
FB.getLoginStatus(function(response) {
if (response && response.status === 'connected') {
FB.logout(function(response) {
document.location.reload();
});
}
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));