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();
精彩评论