title: Facebook login in a Ruby on Rails application
body: <p>I'm developing a Ruby on Rails application using the Facebook flogin button with JavaScript.</p>
  
  <p><strong>My code:*</strong></p>
  
  <pre><code>&lt;fb:login-button perms="email" onlogin="createFbSession();"&gt;&lt;/fb:login-button&gt;
  
  &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:"xxxxxxx", cookie:true,
          status:true, xfbml:true
      });
      function createFbSession() {
          FB.getLoginStatus(function(response) {
              if (response.session) {
                  window.location = "&lt;%= fb_login_path %&gt;";
              }
          });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>When I click on the flogin button, sometimes I receive the following error in the popup window:</p>
  
  <blockquote>
    <p>An error occurred. Please try again later.</p>
  </blockquote>
  
  <p>What does it mean?</p>