为什么FB.login没有删除注销cookie? [英] Why doesn't FB.login delete the logout cookie?
问题描述
我的Facebook身份验证逻辑有问题:
I have a problem with Facebook authentication logic:
- 在主页加载时,我调用
getLoginStatus()
如果我得到已连接
,我会将用户重定向到他的帐户页面。如果没有,用户可以单击调用FB.login()
的登录按钮。 - 如果用户已登录,则导航回主页(整页加载),
getLoginStatus()
按预期返回connected
并获得用户获取退回到帐户页面。 - 但是,当登录用户调用
FB.logout()
并重复步骤1-2时,第二步将始终产生unknown
登录状态。所以,FB.logout()
基本上打破了我的弹跳逻辑。
- On home page load, I call
getLoginStatus()
and if I get"connected"
, I redirect the user to his account page. If not, the user can click the login button that callsFB.login()
. - If the user is logged in and then navigates back to home page (full page load),
getLoginStatus()
there returns"connected"
as expected and user gets bounced back to account page. - However, when the logged in user calls
FB.logout()
and repeats steps 1-2, the 2nd step will always yield"unknown"
login status. So,FB.logout()
basically breaks my bouncing logic.
I检查登录/注销呼叫的机制,它出现 FB.logout()
创建一个 fblo_< appId>
cookie 1年到期,阻止 getLoginStatus()
返回正确的状态。这似乎是让人们退出的实际机制,我可以理解。但是,我无法理解的是:为什么在成功的 FB.login()
电话中没有删除此cookie?
I checked the mechanics of login/logout calls and it appears FB.logout()
creates a fblo_<appId>
cookie with 1 year expiration that blocks getLoginStatus()
from returning the proper status. This seems to be the actual mechanism for keeping people logged out, which I can understand. What I can't understand, though, is: why this cookie is not deleted on a successful FB.login()
call?
推荐答案
我通过以编程方式删除了FB.login的回调函数中的cookie fblo_< appid>
来自行修复它( )和FB.logout()
I fixed it myself by programatically deleting the cookie fblo_<appid>
in callback functions of both FB.login() and FB.logout()
这篇关于为什么FB.login没有删除注销cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!