example code for the Facebook API Ben bir null session nesnesi olsun, ve ben kod Yorumu veren null olmayan bir nesneyi almak gerekir Koşu. What am I doing wrong?
Diğer bir deyişle, benim index.php örnek kodun gösterdiği bu fragmanı "no session" benim tarayıcıda http://apps.facebook.com/my_app gittiğinizde:
<?php
require './facebook.php';
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => '...', // actual value replaced by '...' for this post
'secret' => '...', // actual value replaced by '...' for the post
'cookie' => true,
));
// We may or may not have this data based on a $_GET or $_COOKIE based session.
//
// If we get a session here, it means we found a correctly signed session using
// the Application Secret only Facebook and the Application know. We dont know
// if it is still valid until we make an API call using the session. A session
// can become invalid if it has already expired (should not be getting the
// session back in this case) or if the user logged out of Facebook.
$session = $facebook->getSession();
if ($session) {
echo "session ok";
}
else {
echo "no session";
}
?>
Not: benim sunucu index.php ve facebook.php aynı klasörde içinde.