I am trying to integrate Facebook Connect as the only means of logging in to our community site. I am having a problem with session persistence as my application seems to regularly loses it's Facebook login session.
First, I'd like to know if I have to execute this code for each page on my site:
$fb_params = array(
'appId' => $id,
'secret' => $secret,
'cookie' => $cookie,
);
$facebook = new Facebook($fb_params);
Next, I have this tag to render the user login:
<fb:login-button perms="offline_access, email, user_location, user_online_presence, user_photos, user_status, read_friendlists, user_about_me"></fb:login-button>
As you can see I already have the "offline_access" attribute set but still, my application seems to lose the login session as getSession() regularly returns NULL value after a few minutes.
Help would be very much appreciated.