We have a custom facebook login which I wrote for our website sourcecodedb.com and without any changes to our code the facebook login stopped working around april 15th 2012, our twitter api also got very slow but thats another problem. This is the page users are sent to when they click the login button.
<?php
require_once('fbsdk/facebook.php');
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
));
$params = array('scope' => 'read_stream, email', 'redirect_uri' => 'http://sourcecodedb.com/loggedin.php'); //parameter vi vill anv채nda fr책n facebook anv채ndare
$loginUrl = $facebook->getLoginUrl($params);
header('Location: '.$loginUrl);
?>
And then the page that processes the login looks sort of like this, I took out some of the code.
<?php
include_once('header.php');
require_once('fbsdk/facebook.php');
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
));
$fbuid = $facebook->getUser(); //Detta tar facebook användarens id från en aktiv session
echo 'fbid: '.$fbuid.'</br>';
if($fbuid)
{
$user_profile = $facebook->api('/me','GET');
$name = $user_profile['first_name'];
$lname = $user_profile['last_name'];
$fbid = $user_profile['id'];
}
This was added for debugging and always returns 0
echo 'fbid: '.$fbuid.'</br>';
Any help is appreciated!