2

Possible Duplicate:
Running facebook application on localhost

I am trying to start off some standard Facebook integration for my next web-app. This is my CakePHP + Facebook SDK code.

$app_id = 'MY_APP_ID';
$secret = 'MY_APP_SECRET';

App::import('Vendor', 'facebook/facebook');
$facebook = new Facebook(array(  'appId'  => $app_id,  'secret' => $secret));    

echo $facebook->getUser();

The output this gives me is (even though I'm logged in)

0

Now from what I've read on the internet the only reason this is happening is because I'm running on localhost. I am using the latest version of the SDK.

Is there a fix to this? Ideally I'd like to continue testing on localhost.

Community
  • 1
  • 1
Angad
  • 2,803
  • 3
  • 32
  • 45

0 Answers0