开发者

Face book Logout for a web site

开发者 https://www.devze.com 2023-03-24 09:57 出处:网络
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 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/

0

精彩评论

暂无评论...
验证码 换一张
取 消