注销 JS SDK 并不会注销 PHP SDK
我有一个同时使用 PHP SDK 和 JS SDK 的网站。
在两者中更新到 OAuth 后,我注意到退出 JS 并没有真正使用户退出 PHP。
似乎一般的解决方案是调用“/me”,然后,如果出现错误,则假设用户已注销。但是,我不需要在每个页面渲染上调用 /me,我只想知道用户是否已登录,而不会在每个渲染上调用 FB API 影响性能。
有没有办法让 PHP SDK 通过 JS SDK 获知发生的注销?
我尝试过的一些事情:
- 注释掉 Facebook.php 中 setPersistentData 的内容
- 手动删除 fbsr_::appid:: cookie
谢谢!
I have a website that is using both the PHP SDK and JS SDK.
After updating to OAuth in both, I've noticed that logging out of JS doesn't actually log the user out of PHP.
It seems like the general solution is to make a call for '/me' and then, if that errors, assume the user has logged out. However, I don't need to call /me on every page render, I just want to know whether the user is signed in without the performance hit of a FB API call on every render.
Is there a way for the PHP SDK to be informed of a logout that happened via the JS SDK?
Some things I've tried:
- Comment out the contents of setPersistentData in Facebook.php
- Manually delete the fbsr_::appid:: cookie
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 facebook 库获取用户访问令牌
,然后在注销功能中使用此代码
并对 facebook 库文件进行一些更改。
get the user access token from facebook library
and then use this code in the logout function
And make some changes in facebook library file.