title: Facebook Omniauth: This authorization code has expired
body: <p>I first got this error on a callback for my facebook login in rails. I can't remember the rest of it but after that, I can't reproduce it.</p>
  
  <p>I am now getting an error when I do the same login attempt</p>
  
  <p><code>if user = User.find_from_omniauth(env["omniauth.auth"])</code></p>
  
  <p>which puts the error on</p>
  
  <p><code>User.where(auth.slice(:provider, :uid)).limit(1).first</code></p>
  
  <p>It simply says
  <code>Node with id 133354</code> and <code>Neo4j::Session::CypherError in SessionsController#create</code></p>
  
  <p>Here's some code on the client side authorization which is based off the <a href="http://railscasts.com/episodes/360-facebook-authentication" rel="nofollow">http://railscasts.com/episodes/360-facebook-authentication</a></p>
  
  <pre><code>jQuery -&gt;
    $('body').prepend('&lt;div id="fb-root"&gt;&lt;/div&gt;')
  
    $.ajax
      url: "#{window.location.protocol}//connect.facebook.net/en_US/all.js"
      dataType: 'script'
      cache: true
  
  
  window.fbAsyncInit = -&gt;
    FB.init(appId: '&lt;%= ENV["FACEBOOK_KEY"] %&gt;', cookie: true)
  
    $('#sign_in').click (e) -&gt;
      e.preventDefault()
      FB.login (response) -&gt;
        window.location = '/auth/facebook/callback' if response.authResponse
      , scope: "public_profile,email,user_birthday,user_friends"
  
  
    $('#sign_out').click (e) -&gt;
      FB.getLoginStatus (response) -&gt;
        FB.logout() if response.authResponse
      true
  
    if $('#sign_out').length &gt; 0
      Fb.getLoginStatus (response) -&gt;
        window.location = $('#sign_out').attr("href") if !response.authResponse
  </code></pre>
  
  <p>Not entirely sure where to start to debug this?</p>
  
  <p>Update:
  It seems I can't even acesss <code>http://localhost:7474/browser/</code> When I try to pull up all nodes, it gives me "unknown error". First error has wrecked havoc on the db??</p>