Oauth Logout using facebook api graphics

I just created a site where I allow users to use oauth2.0 and api. I also want to log out from my website and facebook when they click the logout button. I can not find a solution for the last 24 hours. My code is in asp.net. Thanks at Advance

+6
graph facebook
source share
2 answers
<a href="#" onclick="FB.logout();">logout</a> 
+1
source share

If you redirect the user to the login page, you must put the redirection in a callback function, which can be passed to FB.logout as a parameter, for example:

<a href="#" onclick="mysignout(url);">logout</a>

 function mysignout(url) { FB.logout(function() { top.location.href = 'url' }); } 

FB.logout seems to be making an ajax call to cancel authentication on the server and may take a few seconds to complete successfully. If you redirect the link to the binding, then FB.logout will not succeed before being redirected in some browsers. In particular, this will happen with IE.

See this post: FB.logout not working in IE8

+1
source share

All Articles