开发者

facebook login, getuser not working properly

I'm trying to add a facebook login to my site but the problem is that the facebook function "getU开发者_开发技巧ser" only works sometimes. Half the time I'll get the user's facebook id from it, but half the times I won't.

Is there a delay somewhere? How can I fix this?

My if facebook_uid set fails and it all ends up in a big mess. :(

Facebooks getSession never fails though. All the above happens when a facebook session is correctly initiated.

Please help!

Here's part of my code:

$facebook = new Facebook(array('appId' => '123','secret' => '789','cookie' => true,));
$facebook_session = $facebook->getSession();
if ($facebook_session) $_SESSION['facebook_uid'] = $facebook->getUser();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜