title: facebook api login issue, token does not existe
body: <p>i'm using currently Facebook API php sdk login with a callback URL, the code in my local machine is working perfectly but when i put it on server and change the links to the new domain it doesn't work anymore, the the callback URL doesn't get any token from the app any help pls
  this is my code</p>
  
  <pre><code>&lt;?php 
  require_once 'facebook-php-sdk-5/src/Facebook/autoload.php';
  $fb = new Facebook\Facebook([
    'app_id' =&gt; 'appid',
    'app_secret' =&gt; 'appsecret',
    'default_graph_version' =&gt; 'v2.7',
  ]);
  
  session_start();
  //session_destroy(); exit;
  
  $helper = $fb-&gt;getRedirectLoginHelper();
  $permissions = ['email', 'publish_actions']; // optional
  
  
  # login-callback.php
  
  try {
    $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($_GET['fb_email'])) {
  
      echo '&lt;a&gt;Facebook!&lt;/a&gt;';
  
      if(!empty($_GET['fb_email']) and filter_var($_GET['fb_email'], FILTER_VALIDATE_EMAIL)) {
  
  
  
          include_once 'function file';
          $name=$_SESSION['fb_user_info']['name'];
          $email=$_GET['fb_email'];
          $id_network=$_SESSION['fb_user_info']['id'];
          $network="facebook";
          $res=functionname($parameters);
          if($res==0){
            //echo "&lt;script&gt;alert('ajouter avec succes');&lt;/script&gt;";
            header("location:etape-1.php");
          }
          else{
            //echo "&lt;script&gt;alert('id existe deja ');&lt;/script&gt;";
            header("location:etape-1.php");
          }
      }
  
  }
  
  else if (isset($accessToken)) {
  
      $_SESSION['facebook_access_token'] = (string) $accessToken;
  
  
      try {
        // Returns a `Facebook\FacebookResponse` object
        $response = $fb-&gt;get('/me?fields=id,name,email', $_SESSION['facebook_access_token']);
      } catch(Facebook\Exceptions\FacebookResponseException $e) {
        echo 'Graph returned an error: ' . $e-&gt;getMessage();
        exit;
      } catch(Facebook\Exceptions\FacebookSDKException $e) {
        echo 'Facebook SDK returned an error: ' . $e-&gt;getMessage();
        exit;
      }
  
      $user = $response-&gt;getGraphUser();
      $_SESSION['fb_user_info']=$user;
  
  
      echo '&lt;a&gt;Facebook!&lt;/a&gt;';
  
  
      if($user['email']=="" or $user['email']=="undefined" or is_null($user['email'])) {
          header('location:?fb_email=notfound');
      }
      else {
          include_once 'function file';
          $name=$user['name'];
          $email=$user['email'];
          $id_network=$user['id'];
          $network="facebook";
          $res=functionname($parameters);
          if($res==0){
            //echo "&lt;script&gt;alert('ajouter avec succes');&lt;/script&gt;";
            header("location:etape-1.php");
          }
          else{
            //echo "&lt;script&gt;alert('id existe deja ');&lt;/script&gt;";
            header("location:etape-1.php");
          }
      }
  
  }
  else {
  
      /*$loginUrl = $helper-&gt;getLoginUrl(
          array('scope'         =&gt; 'publish_actions,email')
      );*/
      $loginUrl = $helper-&gt;getLoginUrl('http://callbacklink',
                      array(
                  'scope'         =&gt; 'email,publish_actions'
              )
          );
      echo '&lt;a href="' . $loginUrl . '" id="loginFacebook"&gt;Facebook!&lt;/a&gt;';
  }
  </code></pre>
  
  <p>?></p>
  
  <p>this is the link if u wanna test pls <a href="http://jeu.reseaubmwrecrute.com/jeu.php" rel="nofollow">http://jeu.reseaubmwrecrute.com/jeu.php</a> use facebook connection</p>