Facebook login suddenly stops working?

We have a user login that I wrote for our site sourcecodedb.com, and without any changes in our code, the Facebook subscription stopped working on April 15, 2012, our twitter api is also very slow, but this is another problem. This page users are sent when they click on 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 something like this: I extracted 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 has been added for debugging and always returns 0

 echo 'fbid: '.$fbuid.'</br>'; 

Any help is appreciated!

0
source share
2 answers

Fixed by changing

 CURLOPT_CONNECTTIMEOUT => 10 

For

 CURLOPT_CONNECTTIMEOUT => 60 

in base_facebook.php

0
source

I had the same problem and solved it:

Now it works again for me. Greetings.

0
source

Source: https://habr.com/ru/post/1488024/


All Articles