title: cannot get Facebook Session for login (FB PHP SDK 4.0.0)
body: <p>after various tries, i decided to write here my problem with FB PHP login with SDK 4.0.0.
  The problem is that I cannot retrieve the session, and I don't know why.
  My code (placed in a file named "social.php") is the follow:</p>
  
  <pre><code>session_start();    
  define('fbsdk', "/fbsdk/src/Facebook/");
  require __DIR__ . '/fbsdk/autoload.php';
  
  use Facebook\FacebookSession;
  use Facebook\FacebookRedirectLoginHelper;
  use Facebook\FacebookRequest;
  use Facebook\FacebookResponse;
  use Facebook\FacebookSDKException;
  use Facebook\FacebookRequestException;
  use Facebook\FacebookAuthorizationException;
  use Facebook\GraphUser;
  
  if(isset($_GET['login'])){
      if($_GET['login'] == "fb"){
          $appid = "677652872357474";
          $appsecret = "******";
  
          FacebookSession::setDefaultApplication($appid, $appsecret);
          $helper = new FacebookRedirectLoginHelper('http://localhost/ffideasbox/');
  
          try{
              $session = $helper-&gt;getSessionFromRedirect();
          } catch(FacebookRequestException $ex){
              print_r($ex);
          } catch(Exception $ex){
              print_r($ex);
          }
  
          if(isset($session)){
              echo "Session defined: ".$session;
          } else {
              echo "Session not defined";
          }
      } elseif($_GET['login'] == "tw"){
      } elseif($_GET['login'] == "gp"){
      } else {
         ...
      }
  } else {
      ....
  }
  ?&gt;
  </code></pre>
  
  <p>If I go to the documentation page of Session (<a href="https://developers.facebook.com/docs/php/FacebookSession/4.0.0" rel="nofollow">https://developers.facebook.com/docs/php/FacebookSession/4.0.0</a>), it says me that I can get session by:</p>
  
  <pre><code>// If you already have a valid access token:
  $session = new FacebookSession('access-token');
  
  // If you're making app-level requests:
  $session = FacebookSession::newAppSession();
  </code></pre>
  
  <p>Eventually, which is the access token? And how can I get it?</p>
  
  <p>Then, after have posted here, I added before the session TRY block, this other one:
              $session = FacebookSession::newAppSession();</p>
  
  <pre><code>        try{
              $session-&gt;validate();
          } catch(FacebookRequestException $ex){
              echo $ex-&gt;getMessage();
          } catch(\Exception $ex){
              echo $ex-&gt;getMessage();
          }
  </code></pre>
  
  <p>But I still get the same message: "Session not defined" (wrote by me in the session IF block).</p>
  
  <p>Could someone tell me more about the FBSDK? I read the documentation but I don't understand much.
  Thank you all.</p>
  
  <p>EDIT: I add also the "map" of the sdk folder</p>
  
  <pre><code>-mainfolder
  |-fbsdk
   |-autoload.php
   |-src
    |-Facebook
     |-All the complete facebook sdk
  </code></pre>