–
Update 2012-01-14: For OAuth 2.0 implementation, please refer to the new post.
Facebook Javascript SDK – Logout with OAuth 2.0
Update 2011-12-19: Since Facebook has updated their authentication system and HTTP to OAuth 2.0 and HTTPS. The following example will not work any more. i will update the post later. For more information, you can refer to Jerry Cain – Updated JavaScript SDK and OAuth 2.0 Roadmap
–
Add the following Javascript function for Facebook logout.
function logoutFacebook() {
FB.init({
appId:'<?php print YOUR_APP_ID; ?>', cookie:true,
status:true, xfbml:true
});
FB.logout(function() {
// Reload the same page after logout
window.location.reload();
// Or uncomment the following line to redirect
//window.location = "https://ykyuen.wordpress.com";
});
}
Continue reading Facebook Javascript SDK – Logout →