I am migrating my old FB app to the new graph API using the PHP API
I have two pages: public ones (which require no user login) and private ones (which do)
So th
If I am reading your code correctly, only if no session is returned do you do the redirect? According to comments in Facebook's example, even if you get a session back, you can't assume it's still valid. Only trying an API call that requires a logged in user will you know for sure. This is the best way I've seen to reliably determine login/logout status.
if ($session) {
try {
$me = $facebook->api('/me');
if ($me) {
//User is logged in
}
} catch (FacebookApiException $e) {
//User is not logged in
}
}