title: facebook login, getuser not working properly
body: <p>I'm trying to add a facebook login to my site but the problem is that the facebook function "getUser" only works sometimes. Half the time I'll get the user's facebook id from it, but half the times I won't.</p>
  
  <p>Is there a delay somewhere? How can I fix this?</p>
  
  <p>My <code>if facebook_uid set</code> fails and it all ends up in a big mess. :(</p>
  
  <p>Facebooks <code>getSession</code> never fails though. All the above happens when a facebook session is correctly initiated.</p>
  
  <p>Please help!</p>
  
  <p>Here's part of my code:</p>
  
  <pre><code>$facebook = new Facebook(array('appId' =&gt; '123','secret' =&gt; '789','cookie' =&gt; true,));
  $facebook_session = $facebook-&gt;getSession();
  if ($facebook_session) $_SESSION['facebook_uid'] = $facebook-&gt;getUser();
  </code></pre>