Trying to pull out simple authentication, gives me endless loop.
strangest thing, when using Mixed js and Php api, it works.
<?Php
//uses the PHP SDK. Download from https://github.com/facebook/php-sdk
require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => '306597542762982',
'secret' => '88XXXXXXf1',
));
if(!$facebook->getUser())
header("location: ".$facebook->getLoginUrl ());
var_dump($facebook->getUser());
The above code gives me endless loop.
BUT! if you removed the header redirection, and I use the js sdk only for the login process, it works.
Before ANYTHING, make sure you have the latest SDK. I’ve seen this behavior using an outdated SDK. And the comment in your code points to a deprecated version. Make sure your code is from https://github.com/facebook/facebook-php-sdk and not from https://github.com/facebook/php-sdk as it says in your comment.
Also, you are skipping a couple of steps that you can see in the examples from Facebook on github. Try doing it exactly like they are.
And then
I’m still not positive that
headerwill work, so you might also want to try using a javascript redirect: