如何使用c#facebook api查找用户是否已从facebook注销? [英] how to find whether user is logged out from facebook or not using c# facebook api?

查看:194
本文介绍了如何使用c#facebook api查找用户是否已从facebook注销?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#facebook api查找用户是否已从facebook注销?

how to find whether user is logged out from facebook or not using c# facebook api?

推荐答案

facebook C#API无法实现.只要您的应用程序具有对Facebook的访问令牌,并且Facebook使用此访问令牌响应请求,则用户将登录到Facebook.

另一种方法是使用javascript

Its not possible with the facebook C# API. As long as your application has the access token to the facebook and facebook responds to the requests with this access token, the user is logged into the facebook.

The alternative way is using javascript

<div id="fb-root">

<script type="text/javascript" language="javascript">

window.onload=function()

{

// initialize the library with your Facebook API key

FB.init({ apiKey: 'b65c1efa72f570xxxxxxxxxxxxxxxxx' });

// fetch the status 

// you must have the login status before you can logout

// and if you authenticated via oAuth (server side), this is necessary.

// if you logged in via the JavaScript SDK, you can simply call FB.logout()

// once the login status is fetched, call handleSessionResponse

FB.getLoginStatus(handleSessionResponse);

}

// handle a session response from any of the auth related calls

function handleSessionResponse(response) {

// if we dont have a session (which means the user has been logged out, redirect the user)

if (!response.session) {

window.location = "/mysite/Login.aspx";

return;

}

}

</script>
</div>



这里的更多信息 http://facebooksdk.blogspot.com/2011/06/facebook-logout.html



More info here http://facebooksdk.blogspot.com/2011/06/facebook-logout.html




使用


use
Session.Clear();
            Session.RemoveAll();
            Session.Abandon();


我认为,您应该删除浏览器历史记录.
I think, You should delete your browser history.


这篇关于如何使用c#facebook api查找用户是否已从facebook注销?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆