fb:iframe 中的请求表单重定向远离 Facebook

发布于 2024-08-29 18:41:48 字数 575 浏览 1 评论 0原文

我在 iFrame Facebook 应用程序中有一个 。我设置了 target="_parent",以便回调将针对父 iFrame 而不是其自身,这似乎按预期工作。但是,我没有加载所需的文件,而是被重定向到我的服务器。在 Firebug 中检查请求表单的 POST 响应揭示了这一点:

<script type="text/javascript">
top.location.href = "http://www.facebook.com/login.php?api_key=***&v=1.0&req_perms=&next=http%3A%2F%2F***";
</script>

在发送 jQuery AJAX 请求以更新 iFrame 中的各种元素时,我已经遇到了同样的问题。我通过确保我的标头包含 P3P: CP="CAO PSA OUR" 解决了该问题。这确实是为这个调用设置的(可以在 Firebug 中清楚地看到),但我仍然被重定向到 facebook.com/login.php。

I have an <fb:requestform> in an iFrame Facebook app. I have set target="_parent", so that the callback will target the parent iFrame and not itself, which seems to work as expected. But, instead of my desired file loading, I get redirected to my server. Checking the response of the requestform's POST in Firebug revealed this:

<script type="text/javascript">
top.location.href = "http://www.facebook.com/login.php?api_key=***&v=1.0&req_perms=&next=http%3A%2F%2F***";
</script>

I have already had this same problem when sending jQuery AJAX requests to update various elements in an iFrame. I solved the problem by making sure my headers contain P3P: CP="CAO PSA OUR". That is indeed set for this call as well (can be seen clearly in Firebug), but I still get redirected to facebook.com/login.php.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

我不吻晚风 2024-09-05 18:41:48

我最终只是解决这个问题而不是解决它。我没有在大多数页面上使用 require_login() ,而是将用户的 Facebook ID 及其会话密钥存储在会话变量中,并在后续页面调用中使用它们“重新实例化”用户(使用 $facebook->set_user())。

I eventually ended up working around this problem rather than solving it. Instead of using require_login() on most of my pages, I store the user's Facebook ID and their session key in session variables and use those to "reinstantiate" the user (using $facebook->set_user()) on subsequent page calls.

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