0

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!

Aaron W.
  • 9,254
  • 2
  • 34
  • 45
Uberswe
  • 1,038
  • 2
  • 16
  • 36

2 Answers2

0

Fixed it by changing

CURLOPT_CONNECTTIMEOUT => 10

To

CURLOPT_CONNECTTIMEOUT => 60

in base_facebook.php

Uberswe
  • 1,038
  • 2
  • 16
  • 36
  • This worked, but the site was still very slow, there was an issue with the virtual hosts, where the ips were wrong, causing the slow load time. – Uberswe May 07 '12 at 11:39
0

I had the same problem, and resolved it by:

Now it works for me again. Cheers.

Leigh
  • 28,765
  • 10
  • 55
  • 103
Kliptu
  • 199
  • 1
  • 4
  • 17