Did anyone have this issue with a simple Facebook app or know how to solve it?

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-05-08T20:26:48Z Indexed on 2010/05/08 20:38 UTC
Read the original article Hit count: 293

I have a really simple few lines of Facebook app, using the new Facebook API:

<pre>

<?php

require 'facebook.php';

// Create our Application instance.
$facebook = new Facebook(array(
  'appId'  => '117676584930569',
  'secret' => '**********',                 // hidden here on the post...
  'cookie' => true,
));

var_dump($facebook);

?>

but it is giving me the following output:

http://apps.facebook.com/woolaladev/i2.php would give out

object(Facebook)#1 (6) {
  ["appId:protected"]=>
  string(15) "117676584930569"
  ["apiSecret:protected"]=>
  string(32) "**********"                      <--- just hidden on this post
  ["session:protected"]=>
  NULL
  ["sessionLoaded:protected"]=>
  bool(false)
  ["cookieSupport:protected"]=>
  bool(true)
  ["baseDomain:protected"]=>
  string(0) ""
}

Session is NULL for some reason, but I am logged in and can access my home and profile and run other apps on Facebook (to see that I am logged on).

I am following the sample on:

http://github.com/facebook/php-sdk/blob/master/examples/example.php
http://github.com/facebook/php-sdk/blob/master/src/facebook.php

(download using raw URL: wget http://github.com/facebook/php-sdk/raw/master/src/facebook.php )

Trying on both hosting companies at dreamhost.com and netfirms.com, and the results are the same.

© Stack Overflow or respective owner

Related posts about facebook

Related posts about authentication