title: Where to find the Facebook cookie?
body: <p>I'm kinda new to this so bear with me.
  I've installed a "Login with Facebook" button via the Javascript SDK, which works fine. 
  I've also set up the PHP code (facebook.php)
  I can login successfully to Facebook via javascript but then can't access the UID from the session via php.
  So, how can I get php to access the session javascript sets?
  thanks</p>
  
  <p><strong>Edit:</strong> (Posting code from below here so it'll be easier to read)</p>
  
  <p>I can console log the response and see it.</p>
  
  <pre><code>FB.getLoginStatus(function(response) {
      console.log(response.session.uid);
  });
  </code></pre>
  
  <p>Refresh the page, and try to access the session that was set via php, it comes up null. </p>
  
  <pre><code>require_once(RELATIVE_PATH.'applibs/facebook.php');
  $config = array('appId'=&gt;Config::$fb_app_id, 'secret'=&gt;Config::$fb_secret, 'cookie'=&gt;true);
  $fb = new Facebook($config);
  $fb-&gt;getUser(); // this will equal null because the $fb object isnt finding the cookie supposedly set by javascript
  </code></pre>
  
  <p><em>*</em> Did some debugging in the facebook.php  </p>
  
  <p>on line 358...
      $cookieName = $this->getSessionCookieName();<br>
      // retuns fbs_myNumericAppId, seems like that worked..<br>
      if (isset($_COOKIE[$cookieName])) {<br>
      // FAILS! there is no $_COOKIE['fbs_myNumericAppId']  </p>
  
  <p>That seems logical as how could logging into facebook.com know what my app ID is?<br>
  I also noticed after logging into facebook.com, there's NOTHING facebook related in $_COOKIE.
  So, in order to log into facebook via facebook.com, then have a website notice that login, you have to run FB.login on a page load. 
  Then you have to set a cookie via the javacript info returned into $_COOKIE so the php can pick it up anywhere else.</p>