facebook connect 注销时不会清除会话 cookie

发布于 2024-10-05 04:02:10 字数 597 浏览 6 评论 0原文

我正在一个项目上与 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

微凉徒眸意 2024-10-12 04:02:11

我试过这个

$logoutUrl = $facebook->getLogoutUrl(array('next' => 'some url', 'session_key' => $session_key)) . 'session_key=null';

I tried this

$logoutUrl = $facebook->getLogoutUrl(array('next' => 'some url', 'session_key' => $session_key)) . 'session_key=null';
往事随风而去 2024-10-12 04:02:10

我遇到了这个错误,并意识到这并不是会话没有被清除,而是如果您有离线访问权限,它会自动为您提供一个新会话。

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.

杯别 2024-10-12 04:02:10

尝试在 LoginWindow (AS3) 的某处找到 formatData 函数并找到这一行:

vars.redirect_uri = FacebookURLDefaults.LOGIN_SUCCESS_URL

更改“http://www.facebook.com/”的值并从中注销登录时显示 html 页面。

如果您是开发人员而不是最终用户,这是注销的临时解决方案。

Try finding the formatData function somewhere at LoginWindow (AS3) and find this line:

vars.redirect_uri = FacebookURLDefaults.LOGIN_SUCCESS_URL

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.

听你说爱我 2024-10-12 04:02:10

这已被注册为错误。请向此错误添加您自己的重现,以帮助修复它

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

友谊不毕业 2024-10-12 04:02:10

我今天刚刚解决了一个类似的问题。
尝试使用它来获取您的会话:

$session = $facebook->getSession();

这也可以对注销网址有所帮助:

$logoutUrl = $facebook->getLogoutUrl(array('next' => $url, 'session_key' => $session['session_key']));

希望它有帮助!

I have just a solved a simular problem today.
Try using this to get your session:

$session = $facebook->getSession();

And this could also help for the logout url:

$logoutUrl = $facebook->getLogoutUrl(array('next' => $url, 'session_key' => $session['session_key']));

Hope it helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文