I have a problem with Facebook apps on Internet Explorer. On other browser it works normally, but on IE i get error:
Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /base_facebook.php on line 1340
I find the connection with this error. It's in my code in line
$userinfo = $facebook->api('/me');
Hire is my code:
<?php
session_start();
header('Content-Type: text/html; charset=UTF-8');
require 'facebook.php';
// APPS INICIALIZATION
$appid = '123APPID123';
$facebook = new Facebook(array(
'appId' => $appid,
'secret' => '123SECRETID123',
'cookie' => true,
));
// END - APPS INICIALIZATION
?>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<script src="https://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '123APPID123', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<br>
<?php
// RETRIVAL DATA AND OTHERS INFO
$userid = $facebook->getUser();
$userinfo = $facebook->api('/me');
// END - RETRIVAL DATA AND OTHERS INFO
// PUT DATA TO VARIABLE
$email = $userinfo['email'];
$first_name = $userinfo['first_name'];
$last_name = $userinfo['last_name'];
// DATA TESTER //
echo $email.'<br>';
echo $first_name.'<br>';
echo $last_name.'<br>';
?>
Do you have any idea?