0

I need to logout from Facebook from my application. I tried to watch the other posts, but I didn't find what I need...

I have realised a link like<a href="javascript: FB_LOGOUT()">LOGOUT</a> and I have written a function, but it doesn't work... I tried this 3 methods, but none of them works.

function FB_LOGOUT(){
//FB.logout(function(response) {
//    window.location.reload(true);
//});

//FB.Event.subscribe('auth.logout', function(response) {
//  window.location.reload();
//});

//FB.logout(function()
    //{
    //    top.location.href = 'http://google.com/';
    //});
 }

Can you tell me how to logout from Facebook from my application? Please explain everything you think I'd better know, I'm really ignorant in this field... Thank you :)

AleVale94
  • 727
  • 1
  • 8
  • 14
  • read here: http://stackoverflow.com/questions/7197046/facebook-oauth-fb-getloginstatus-fb-logout-on-ie-chrome-firefox-android-b – Yan Berk May 13 '12 at 06:33
  • I tried all the solutions in the answers, but none of them works.. I'm definetly doing something wrong, but what? The example where I should use a facebook logout button doesn't work for me. If it can be usefull, I use Safari, but I'd like that the logout works on every browser.. – AleVale94 May 13 '12 at 09:32
  • Hi AleVale94, I am also facing the same issue. I have also tried varoius sol but not working, how did u fixed this issue?? – User16119012 Aug 27 '13 at 17:09

1 Answers1

0

Sorry I can't write as comment, try this

FB.logout(function(response) {
  FB.Auth.setAuthResponse(null, 'unknown');

});

this refers to Facebook JS SDK FB.logout() doesn't terminate user session