Facebook API 注销未完全注销用户
我正在使用 Facebook 的 PHP 和 Javascript SDK 开发一个应用程序。
一切都运行良好。但是,当用户使用 php next => 注销时link ,虽然他被重定向了,但他并没有注销。我尝试过使用 Javascript SDK getloginstatus()
并且它有效!
但是,我也想要一个服务器端方法,因为用户可以简单地禁用 javascript 并获得对该站点的访问权限。我还尝试销毁 Facebook 会话和 Cookie,但无济于事,因为我怀疑这可能存在一些问题。
我还应该注意到,如果用户删除了所有会话和 cookie,PHP SDK 能够检测到用户已注销。
我的代码是:
$user = $facebook->getUser();
if ($user) {
//logged in
} else{
//not logged in
}
I'm developing an app using Facebook's PHP and Javascript SDK..
Everything is working superbly. However, when the user logs out using the php next => link , although he is redirected, he is not logged out. What I've tried is using the Javascript SDK getloginstatus()
and it works!
However, I would like a server side method to this as well because a user can simply disable javascript and gain access to the site. I've also tried destroying facebook session and cookies to no avail, as I suspected there might be some issues with that.
I should also note that PHP SDK is able to detect that the user is logged off if the user has deleted all sessions and cookies.
My code is:
$user = $facebook->getUser();
if ($user) {
//logged in
} else{
//not logged in
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不让您的应用程序要求启用 js,否则它们将被定向到无法访问的页面?
why not have your application require js be enabled, else they are directed to a page where access cannot be gained?