в настоящее время я работаю над страницей входа в систему facebook для моей веб-страницы.
но я продолжаю получать сообщение об ошибке «вызов неопределенного метода» в строке 24:
$session = $facebook->getSession();
, когда я удаляю строку 24 все, кажется, идет гладко.
но поскольку я следую руководству на http://www.9lessons.info/2011/01/facebook-graph-api-connect-with-php-and.html и http://net.tutsplus.com/tutorials/php/how-to-authenticate-your-users-with-facebook-connect/ - это вроде меня озадачило!
the сообщение об ошибке
Fatal error: Call to undefined method Facebook::getSession() in C:\xampp\htdocs\kite\index.php on line 24
помогите пожалуйста. Спасибо заранее. вот мой код:
$appid_kite,
'secret' => $secret_kite,
));
// Get User ID
$user = $facebook->getUser();
// Let's see if we have an active session
$session = $facebook->getSession();
// We may or may not have this data based on whether the user is logged in.
//
// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}// Login or logout url will be needed depending on current user state.
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl();
}
ob_start();
?>