title: How to Determine if Facebook User 'Likes' a Certain Page
body: <p>Is there any way to determine if a Facebook user 'likes' a certain page with the API Facebook offers currently?</p>
  <h1>UPDATE</h1>
  <p>I have been trying to get this to work via the PHP graph API for a while now with this code.</p>
  <pre><code>$fbconfig['appid'] = '***';
  $fbconfig['api'] = '***';
  $fbconfig['secret'] = '***';
  
  try {
      include_once &quot;facebook.php&quot;;
  } catch(Exception $o) {
      echo '&lt;pre&gt;';
      print_r($o);
      echo '&lt;/pre&gt;';
  }
  
  $facebook = new Facebook(array(
    'appId'  =&gt; $fbconfig['appid'],
    'secret' =&gt; $fbconfig['secret'],
    'cookie' =&gt; true,
  ));
  
  $session = $facebook-&gt;getSession();
  $me = null;
  
  if ($session) {
      try {
          $uid = $facebook-&gt;getUser();
          $me = $facebook-&gt;api('/me');
      } catch (FacebookApiException $e) {
          d($e);
      }
  }
  
  if($me) {
      try {
          $likes = $facebook-&gt;api('/me/likes');
      } catch(Exception $o) {
          d($o);
      }
  }
  </code></pre>
  <p>However, the session is always null, even though I am logged in.</p>
  <p><em>Apparently</em>, the above code is only good for Facebook Connect &quot;Canvas&quot; applications, I am calling this code from an FBML tab on a Facebook &quot;Page&quot; through an AJAX call to my server.</p>
  <p>I'm not very familiar with all of the Facebook development terminology.</p>
  <p>How can I get the current user's 'likes' in my situation?</p>