Q:

Long live access token granting permissions and scopes

I obtained access token for my facebook app using graph api explorer  and  also a long lived access token from server side. But I am unable to edit the permission and scopes I obtained for the long lived access tokens.
I  have uploaded the screen shots of the access token debugger for both the access tokens obtained from graph api explorer as well as long lived access token obtained from sever side .Please help on how to edit the scopes of long lived access tokens from server side.

As seen in the screen shot  in scopes , it has so many permissions. But the access token I obtained from server side it has only  one scope "public_profile". How should I grant permissions for long lived access token obtained from server side? please help 
My code for login 
<?php

$a=$_GET["query"];

  $app_id = "xxxxxx";
  $app_secret = "xxxxxxxxxx"; 
  $redirect_uri = "http://localhost/url_encode.php/"."?"."f=".$a;
 // echo $my_url;

$dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" 
      . $app_id . "&redirect_uri=" .$redirect_uri;

    echo("<script> top.location.href='" . $dialog_url 
      . "'</script>");

My code for generating the long lived access token.

      <?php
//include ('search_query.php');

$b=$_GET['code'];
$c=$_GET['f'];
//echo $b;
//echo "<br>";
//echo "<br>";
//echo $c;
//$a=$_GET['f'];

$redirect_uri="http://localhost/url_encode.php/"."?"."f=".$c;

if(empty($b)){

  $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" 
      . $app_id . "&redirect_uri=" .$redirect_uri;

    echo("<script> top.location.href='" . $dialog_url 
      . "'</script>");

}

$token_url="https://graph.facebook.com/oauth/access_token?client_id=xxxxxx&redirect_uri=".$redirect_uri."&client_secret=xxxxxxxxx&code=".$b;
$access_token=file_get_contents($token_url);

//echo $access_token;
$position_of_string=strpos($access_token ,"&");
$actual_access_token=substr($access_token,0,$position_of_string);
echo $actual_access_token;

$url="https://graph.facebook.com/".urlencode($c);
$json_object=file_get_contents($url);

?>

A:

You are missing the scope parameter in your login flow: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.2

scope: A comma separated list of Permissions to request from the
  person using your app.

