I followed the example here — https://github.com/facebook/php-sdk :
require 'php-sdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
));
// Get User ID
$user = $facebook->getUser();
Great, it gives me a user id for users logging in through Facebook.
However, for users who aren’t logged in ($user = 0), it creates a useless cookie and starts a session. Is there some way around this? Why does it create a cookie/start a session for a user who doesn’t exist?
The session is started when the Facebook object is created. This is specified in constructor documentation.
Apparently, there is no easy workarround.