0

I am using facebook php sdk in zend. i am not getting user id even i have logged in facebook in another tab. Please help me to fix this issue.

           $facebook = new \Facebook(array(
          'appId'  => FACEBOOK_APP_ID,
          'secret' => FACEBOOK_SECRET,
          'cookie' => true,
           ));

           $user = $facebook->getUser();
           echo $user;

when i am using above code $user return 0 some times.

g v s vinayak
  • 87
  • 3
  • 11

1 Answers1

0

remove the \ before facebook. Correct way will be:

       $facebook = new Facebook(array(
           'appId'  => FACEBOOK_APP_ID,
           'secret' => FACEBOOK_SECRET,
           'cookie' => true,
       ));

Let me know if this helped. kind regards.

vascofmdc
  • 13
  • 1
  • 7
  • i am working on Facebook sdk with ZEND2. For that i have to Create facebook object in this way, since included in `index.php` of public folder – g v s vinayak Oct 03 '13 at 03:56