title: Check if user is logged in New Facebook API
body: <p>well I'm new to the facebook api stuff, and just recently someone told me I was using the old api.</p>
  
  <p>So now, I can't seem to figure out how to check if the user is logged into my site with the new api.</p>
  
  <p>all I really have is </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    FB.init({appId: '(appid)', status: true, cookie: true, xfbml: true});
    FB.Event.subscribe('auth.sessionChange', function(response) {
      if (response.session) {
        // A user has logged in, and a new cookie has been saved
      } else {
        // The user has logged out, and the cookie has been cleared
      }
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>and a login button.</p>
  
  <p>If anyone could show me how to check if someones logged in, (or is that it right there?) because I'd like it to change the login button located in a div called </p>
  
  <p><code>&lt;div id="fbuser"&gt;</code></p>
  
  <p>to welcome the user.</p>
  
  <p>Or even if you can point me towards some useful tutorials, that would be great!</p>
  
  <p>Thanks</p>