title: php graph api multi page access user object - canvas app
body: <p>I have several pages in my <code>canvas app</code> and from <code>page-a</code> the user logs into oAuth then gets directed to <code>page-b</code> which has the code below.<br />
  When i login oAuth using javascript api i can get full access to the user object. <br />
  But then when i go to another page, the code below gives an error. <br /><br />
  The <code>token</code> echo's out but <code>getUser</code> does not.<br /><br />
  It looks like <code>$user = $facebook-&gt;getUser();</code> never gets called, or as <code>CBroe</code> pointed out, it prob. returns 0 <br /><br /></p>
  
  <p>Is there a way to have just the php access <code>user object</code> without javascripts api so that i can traverse page to page?<br /></p>
  
  <pre><code>require_once('/facebook-php-sdk-3.1.1-25-6c82b3f/src/facebook.php');
  $facebook = new Facebook(array(
      'appId'  =&gt; '&lt;MY-APP-ID&gt;',
      'secret' =&gt; '&lt;MY-APP-SECRET&gt;'
  ));
  
  // Get User ID
  $user = $facebook-&gt;getUser();
  $token = $facebook-&gt;getAccessToken();
  
  if ($user) {
      try {
          $facebook-&gt;setFileUploadSupport(true);
  
          $fbUser = $facebook-&gt;api('/me');
  
      } catch (FacebookApiException $e) {
          error_log($e);
          $user = null;
      }
  }
  
  /*      **          **          **
  Undefined variable: fbUser 
  **          **          **          */
  
  //print_r($fbUser); 
  echo $fbUser['id']; 
  echo '&lt;br/&gt;';
  echo $fbUser['name']; 
  </code></pre>