title: Access users data using AccessToken ONLY in Facebook Graph Api
body: <p>I am trying to Access users friends information using access token.</p>
  
  <p>So i create a facebook object.</p>
  
  <pre><code>$facebook = new Facebook(array(
              'appId' =&gt; APP_ID,
              'secret' =&gt; APP_SECRET,
              ));
  </code></pre>
  
  <p>I then set the access token to that object.</p>
  
  <pre><code>$facebook-&gt;setAccessToken(TOKEN);
  </code></pre>
  
  <p>Then when i try to retrieve the user information it returns 0.</p>
  
  <pre><code>$user = $facebook-&gt;getUser();
  </code></pre>
  
  <p>So the code below does not get executed.</p>
  
  <pre><code>if ($user) 
  {
      try 
      {
          // Proceed knowing you have a logged in user who's authenticated.
          $user_profile = $facebook-&gt;api('/me');
      } 
      catch (FacebookApiException $e) 
      {
          error_log($e);
          $user = null;
      }
  }
  </code></pre>
  
  <p>Can anyone tell me where my mistake lies.</p>