Facebook登录窗口出现并消失很快 [英] Facebook login window appears and disappears very quickly

查看:127
本文介绍了Facebook登录窗口出现并消失很快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我上传了一段代码到phpfog,我遇到了一个本地没有发生的问题:



当页面加载时,它试图获得应该设置的$ idFacebook:

  $ idFacebook = $ facebook-> getUser(); 
if($ idFacebook){...}

我已经登录到Facebook,然而,条件失败,出现登录按钮:

 < div class =fb-login-buttondata-范围= user_likes,user_photos >< / DIV> 

另一个问题是,当我按下按钮时,似乎登录窗口出现,但它关闭自动非常快速。



我的代码与创建Facebook应用程序时Heroku提供的代码基本相同。存储库是这样的: https://github.com/heroku/facebook-template-php。我找不到如何解决它,我已经看到很多人遇到了Facebook登录的几个问题。



我期待着你可以帮助我。
提前感谢

解决方案

我的实际错误是$ facebook-> getUser()返回0,因为该应用没有通过身份验证,并且应用程序未通过身份验证,因为我将代码从主机移动到另一个域中的另一个,我忘记了在 http://developers.facebook.com



现在,应用程序自动获取登录名。
感谢大家!


Recently I've uploaded a piece of code to phpfog and I've come across with a problem which didn't happen locally:

When the page loads, it tries to get $idFacebook that is supposed to be set:

$idFacebook = $facebook->getUser();
if ($idFacebook) { ... }

I'm logged to Facebook, however, the condition fails and the button to login appears:

<div class="fb-login-button" data-scope="user_likes,user_photos"></div>

The other problem is that when I press the button, it seems that the login window appears but it closes automatically very quickly.

My code is basically the same that Heroku provides when you create a Facebook app. The repository is this one: https://github.com/heroku/facebook-template-php. I can't find how to solve it and I've seen that lots of people have experienced several problems with facebook login.

I'm looking forward you can help me. Thanks in advance.

解决方案

My actual error was that $facebook->getUser() returned 0 because the app wasn't authenticated and the app wasn't authenticated because I moved my code from a host to another in a different domain and I forgot changing the application configuration in http://developers.facebook.com.

Now, the app gets the login automatically. Thanks everybody!

这篇关于Facebook登录窗口出现并消失很快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆