facebook connect 注销时不会清除会话 cookie
我正在一个项目上与 Facebook 进行一些集成(使用图形 api),一切都工作正常,直到现在我发现当我单击注销 url 时,facebook 不会清除我的会话。我通过 php 而不是 javascript 进行注销,因此注销 url 如下所示:
https://www.facebook.com/logout.php?next=url&access_token=token
单击该链接后,用户在 facebook 上注销,但会话仍然存在于我的网站上。要真正清除会话,我必须在单击该网址后再次刷新页面。在我看来,这是一种奇怪的行为。
大家对此有何看法?我什至尝试亲自删除 Facebook cookie,但它仍然存在,并且只有在我点击浏览器上的刷新按钮后才会被清除。
ps 为了获得 facebook 会话,我做了这样的事情:
My_Facebook_Helper::instance()->getSession(); //it should be === null if it doesn't exist
pps 这可能是一个错误?我不记得大约一周前我第一次开始实施这个问题时遇到过这个问题
I'm doing some integration with Facebook on a project (using graph api) and everything was working fine until now I discovered that facebook doesn't clear my session when I click on the logout url. I'm doing logout through php, not javascript, so the logout url looks like:
https://www.facebook.com/logout.php?next=url&access_token=token
After clicking on that link the user is logged out on facebook, but the session still exists on my website. To actually clear the session I have to refresh the page one more time after clicking that url. This is a strange behavior, in my opinion.
What you guys think of this? I tried even to personally remove the facebook cookie, but it is still there, and it is cleared only after I hit the refresh button on my browser.
p.s. to get the facebook session I do something like this:
My_Facebook_Helper::instance()->getSession(); //it should be === null if it doesn't exist
p.p.s. it could be a bug? i don't remember having this issue about a week ago when I first started to implement this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我试过这个
I tried this
我遇到了这个错误,并意识到这并不是会话没有被清除,而是如果您有离线访问权限,它会自动为您提供一个新会话。
I ran into this bug and realized it wasn't that the session wasn't being cleared, but if you have offline access, it will automatically get you a new session.
尝试在
LoginWindow
(AS3) 的某处找到formatData
函数并找到这一行:更改“http://www.facebook.com/”的值并从中注销登录时显示 html 页面。
如果您是开发人员而不是最终用户,这是注销的临时解决方案。
Try finding the
formatData
function somewhere atLoginWindow
(AS3) and find this line:Change the value for 'http://www.facebook.com/' and logout from that html page when logged in.
This is a temporary solution to logout if you are developer, not the end user.
这已被注册为错误。请向此错误添加您自己的重现,以帮助修复它
http://developers.facebook.com/bugs/ 250825644953332
This is registered as a bug. Please add your own repro to this bug to help get it fixed
http://developers.facebook.com/bugs/250825644953332
我今天刚刚解决了一个类似的问题。
尝试使用它来获取您的会话:
这也可以对注销网址有所帮助:
希望它有帮助!
I have just a solved a simular problem today.
Try using this to get your session:
And this could also help for the logout url:
Hope it helps!