title: Rails Detect If User's Very First Visit
body: <p>I'm trying to make the user fill out a questionnaire if it is their first time visiting the site. </p>
  
  <p>My controllers are set up like this:</p>
  
  <pre><code>class MainController &lt; BaseController
  end
  
  class BaseController &lt; ApplicationController
    before_filter :first_time_visiting?
  end
  
  class ApplicationController &lt; ActionController::Base
    def first_time_visiting?
      if session[:first_time].nil?
        session[:first_time] = 1
        redirect_to questionnaire_path unless current_user
      end
    end
  end
  </code></pre>
  
  <p>When I close the browser and re-open it though, I always get redirected to the questionnaire.</p>