Bonjour,

Je suis en train d'apprendre à concevoir une application Facebook.

J'ai le code suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
include_once 'init.php';
 
$user = User::getLoggedIn();
 
if (!$user)
{
	echo "Here1";
	echo "Non connecté";
	exit;
}
else
{
	echo "Here2";
	$appapikey = 'xxxxxx';
	$appsecret = 'xxxxxx';
	$facebook = new Facebook($appapikey, $appsecret);
	//
	$user_id = $facebook->require_login();
	//
	$infos = $facebook -> api_client -> fql_query("SELECT first_name, last_name FROM user WHERE uid='$user_id'");
	$prenom = $infos[0]['first_name'];
	$nom = $infos[0]['last_name'];
	echo "".count($infos)."UID $user_id a pour nom <strong>$nom</strong> et pour prenom <strong>$prenom</strong>";
}
Cependant, je n'obtient pas le même résultat dans tout les navigateurs:

Dans Firefox:

Here2
Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid' in /home/kenpus/www/app/facebook-client/facebookapi_php5_restlib.php:1915 Stack trace: #0 /home/kenpus/www/app/facebook-client/facebookapi_php5_restlib.php(379): FacebookRestClient->call_method('facebook.fql.qu...', Array) #1 /home/kenpus/www/app/test.php(22): FacebookRestClient->fql_query('SELECT first_na...') #2 {main} thrown in /home/kenpus/www/app/facebook-client/facebookapi_php5_restlib.php on line 1915
Dans Chrome et IE

Here1Non connecté
Pourquoi le code n'est pas interprété de la même manière ?

Merci