title: Pass parameter to Facebook login callback
body: <p>I've this simply facebook login integration.
  I need to pass to the callback (that in this case is this same page) a custom parameter but the new $helper->getLoginUrl does not allow adding params. Previuosly I see that there was a next parameter that can be used to store a string but now it was removed. 
  It seems that I can't add a custom param neither in the session. 
  Is there any method to achieve my purpose?</p>
  
  <pre><code>&lt;?php 
  require '../facebooksrc/autoload.php';
  
  $userdata='/me?fields=name,first_name,last_name,email,gender,location,birthday';
  $permissions = ['email, user_location, publish_actions, user_birthday'];
  
  $fb = new Facebook\Facebook([
    'app_id' =&gt; $appid,
    'app_secret' =&gt; $appsecret,
    'default_graph_version' =&gt; 'v2.5',
    ]);
  $helper = $fb-&gt;getRedirectLoginHelper();
  
  $_SESSION['FBRLH_state']=$_GET['state'];
  
  try {
      if (isset($_SESSION['facebook_access_token'])) {
          $accessToken = $_SESSION['facebook_access_token'];
      } else {
          $accessToken = $helper-&gt;getAccessToken();
      }
  } catch(Facebook\Exceptions\FacebookResponseException $e) {
      // When Graph returns an error
      echo 'Graph returned an error: ' . $e-&gt;getMessage();
      exit;
  } catch(Facebook\Exceptions\FacebookSDKException $e) {
      // When validation fails or other local issues
      echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
      exit;
   }
  if (isset($accessToken)) {
      if (isset($_SESSION['facebook_access_token'])) {
          $fb-&gt;setDefaultAccessToken($_SESSION['facebook_access_token']);
      } else {
          // getting short-lived access token
          $_SESSION['facebook_access_token'] = (string) $accessToken;
          // OAuth 2.0 client handler
          $oAuth2Client = $fb-&gt;getOAuth2Client();
          // Exchanges a short-lived access token for a long-lived one
  
          //$longLivedAccessToken = $oAuth2Client-&gt;getLongLivedAccessToken($_SESSION['facebook_access_token']);
          //$_SESSION['facebook_access_token'] = (string) $longLivedAccessToken;
          // setting default access token to be used in script
          $fb-&gt;setDefaultAccessToken($_SESSION['facebook_access_token']);
      }
      // redirect the user back to the same page if it has "code" GET variable
      if (isset($_GET['code'])) {
          header('Location: ./');
      }
      // getting basic info about user
      try {
          $profile_request = $fb-&gt;get($userdata);
          $profile = $profile_request-&gt;getGraphNode()-&gt;asArray();
  
      } catch(Facebook\Exceptions\FacebookResponseException $e) {
          // When Graph returns an error
          echo 'Graph returned an error: ' . $e-&gt;getMessage();
          exit;
      } catch(Facebook\Exceptions\FacebookSDKException $e) {
          // When validation fails or other local issues
          echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
          exit;
      }
  
  
      $firstname=$profile["first_name"];
      $lastname=$profile["last_name"];
  
      // MY INSERT QUERY  
  
  } else {
      $url="myurl";
  
      $loginUrl = $helper-&gt;getLoginUrl($url, $permissions);
  
      //REDIRECT
      header("Location: $loginUrl");
  
  }
  </code></pre>