Face book Logout for a web site
I have been using the facebook C# sdk from http://multitiered.wordpress.com/2010/08/05/getting-started-with-the-facebook-c-sharp-sdk/
I am trying to logout through javascript but the session still persists even though i redirect the url.Kindly help.
I am using VS 2008 3.5 frame work.
I have used the following client side code but still it is not logging out.
function facebook_logout(){
var appids = '<%= clientId %>';
FB.init({ appId: appIds, status: true, cookie: true, xfbml: true })开发者_开发技巧;
FB.Event.subscribe('auth.logout', function(response) {
var url = window.parent.location.href;
url = (url + (url.indexOf('?') > -1 ? '&' : '?') + (new Date()).getTime());
window.location.href = url;
});
}
Try to use this function to logout:
FB.logout(function(response) {
// user is now logged out
});
Why don't you use the facebook login button which facebook provides.
http://developers.facebook.com/docs/reference/plugins/login/
精彩评论