title: Get facebook user birthday with API
body: <p>I'm trying to get user birthday with facebook API. I do know we need now to ask permission for this. I don't really know how it works </p>
  
  <p>Just found this to add:</p>
  
  <pre><code>if ($user) {
      $logoutUrl = $facebook-&gt;getLogoutUrl();
  } else {
      $loginUrl = $facebook-&gt;getLoginUrl(
       array('req_perms' =&gt; 'email,read_stream')
  );
  }
  
  &lt;fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"&gt;&lt;/fb:login-button&gt;
  </code></pre>
  
  <p>and this is my whole code ( quite basic ):</p>
  
  <pre><code>&lt;?php
  require 'php-sdk/src/facebook.php';
  $facebook = new Facebook(array(
              'appId' =&gt; '4539768XXXXX',
              'secret' =&gt; 'fe86f3b0b34b3eXXXXXXXXXX',
              'cookie' =&gt; true,
          ));
  
  $signedRequest = $facebook-&gt;getSignedRequest();
  $liked = $signedRequest["page"]["liked"];
  
  
  // Get User ID
  $user = $facebook-&gt;getUser();
  
  
  
  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;
      }
  }
  
  // Login or logout url will be needed depending on current user state.
  if ($user) {
      $logoutUrl = $facebook-&gt;getLogoutUrl();
  } else {
      $loginUrl = $facebook-&gt;getLoginUrl(
       array('req_perms' =&gt; 'email,read_stream')
  );
  }
  ?&gt;
  
  
  &lt;!doctype html&gt;
  &lt;html xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
      &lt;head&gt;
          &lt;style&gt;
              body {
                  font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
              }
              h1 a {
                  text-decoration: none;
                  color: #3b5998;
              }
              h1 a:hover {
                  text-decoration: underline;
              }
          &lt;/style&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
  
          &lt;?php
          if ($liked) {
              header("Location:youlike.php");
          } else {
              echo "you don't like yet";
          }
          ?&gt;
  
  
  &lt;fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"&gt;&lt;/fb:login-button&gt;
  
          &lt;?php if ($user): ?&gt;
              &lt;a href="&lt;?php echo $logoutUrl; ?&gt;"&gt;Logout&lt;/a&gt;
          &lt;?php else: ?&gt;
              &lt;div&gt;
                  Login:
                  &lt;a href="&lt;?php echo $loginUrl; ?&gt;"&gt;Login with Facebook&lt;/a&gt;
              &lt;/div&gt;
          &lt;?php endif ?&gt;
  
          &lt;?php if ($user): ?&gt;
              &lt;h3&gt;Vous&lt;/h3&gt;
              &lt;img src="https://graph.facebook.com/&lt;?php echo $user; ?&gt;/picture"&gt;
  
              &lt;h3&gt;Personne connectée&lt;/h3&gt;
              &lt;pre&gt;&lt;?php print_r($user_profile); ?&gt;&lt;/pre&gt;
          &lt;?php else: ?&gt;
              &lt;strong&gt;&lt;em&gt;Vous n'etes pas loggé!&lt;/em&gt;&lt;/strong&gt;
          &lt;?php endif ?&gt;
  
  
      &lt;/body&gt;
      &lt;script&gt;
      &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i would appreciate your help 
  thanks in advance!</p>