How can I ask for permissions using new PHP SDK? I don\'t want to use the graph api and parse the url all the time. When the application is opened it should automatically ask fo
Session Based Login with scope and Logout with access_token for PHP-SDK 3.2.0.
'135669679827333',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxx',
));
$user = $facebook->getUser();
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
$user = null;
}
}
if ($user) {
$params = array(access_token => ''.$access_token.'');
$logoutUrl = $facebook->getLogoutUrl($params);
} else {
$params = array(
scope => 'read_stream,publish_stream,publish_actions,read_friendlists',
//redirect_uri => $url
);
$loginUrl = $facebook->getLoginUrl($params);
};
$access_token = $_SESSION['fb_135669679827333_access_token'];
?>
.
Login & Connect
Login & Connect