The FIRST time my index.php loads I get a value of 0 when calling:
$facebook->getUser();//returning 0 instead of id on first page load
The call works fine on any subsequent page load.
This is my code:
$facebook = new Facebook(array(
'appId' => $FB_APP_ID,
'secret' => $FB_APP_SECRET
));
$user_id = $facebook->getUser();//Returns 0 on first load.
Has anyone else experienced this? Maybe I should automatically reload the page if $facebook->getUser();
does not return a valid user?