会话无效,因为用户已注销 [英] The session is invalid because the user logged out

查看:176
本文介绍了会话无效,因为用户已注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我遇到了这种情况,现在我仍在努力解决问题.

这是场景:

1.用户访问我的网站

2.用户单击登录到FB"(以便我的应用程序通过Api图检索其FB信息).

3.用户使用其FB凭据登录并批准该应用程序.

4.用户被重定向回到他单击登录到FB"按钮的同一页面(在步骤2中,因为该按钮将调用RedirectToFacebookAuthorization()方法).

5.然后,用户从Facebook.com注销(在这种情况下,我的网站尚未实现任何注销按钮).

6.用户已成功从其FB帐户注销,他重新访问了我的网站.

7.我的网站抛出如下异常消息:

异常详细信息:Facebook.Utility.FacebookException:该会话无效,因为用户已注销.

Hi guys,

I have a situation here and I''m still cracking my head on how to solve it.

Here''s the scenario:

1. User visits my website

2. User clicks on Login to FB (in order for my App to retrieve his FB info via the Api graph).

3. User logins with his FB credential and Approve the App.

4. User is redirected back to the same page that he clicks on the Login to FB button (in step 2, because the button, will invoke the method RedirectToFacebookAuthorization() ).

5. User then logs out from Facebook.com (my website hasn''t implement any log out button for this scenario).

6. User has successfully logged out from his FB account, he revisit my website.

7. My website throws out an exception message as below:

Exception Details: Facebook.Utility.FacebookException: The session is invalid because the user logged out.

推荐答案

异常表示您正在尝试访问来自facebook(api ),该用户需要登录到Facebook,但根据步骤5-6,用户已经从那里注销.

如果在步骤#6之后收到此异常,则它是完全有效的.

虽然我可能是错的,但首先看起来像是问题.
Exception says that you are trying to access something from the facebook(api) which needs the user to be logged in to the facebook but according to step #5-6 user has already logged out from there.

If you are getting this exception after step #6, then it is completely valid.

I may be wrong though, but this is what looks like the issue on the first place.


我怀疑您的问题是因为您保留了有关注销会话的信息.我猜您正在持有某种变量,该变量具有有关Facebook会话的信息.当您退出该会话,然后通过再次登录开始新的会话时,则需要重新创建变量.

可能是您缺少任何dll或facebook实用工具的更新的dll.
这些链接会有所帮助:-

http://forum.developers.facebook.net/viewtopic.php?id=54994 [ ^ ]

http: //www.symbolsource.org/Public/Metadata/Default/Project/Facebook-Developer-Toolkit/Version-3.01/Release/All/Facebook/Facebook/Utility/FacebookException.cs [
I suspect that your problem is because you have retained information about the session that you logged out from. I guess you are holding some sort of variable which has information about a facebook session. When you log out of that session and then start a new sesison by loging in again then you need to recreate the variable.
OR
may be you are missing any dll or an updated dll for facebook utility.
these links will be helpful:-

http://forum.developers.facebook.net/viewtopic.php?id=54994[^]

http://www.symbolsource.org/Public/Metadata/Default/Project/Facebook-Developer-Toolkit/Version-3.01/Release/All/Facebook/Facebook/Utility/FacebookException.cs[^]


这篇关于会话无效,因为用户已注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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