title: Devise - Make a request without resetting the countdown until a user is logged out due to inactivity
body: <p>I'm working on a RoR app with Devise. I want to let clients send a request to the server to see how much time is left until the user on the client is automatically logged out due to inactivity (using the <code>Timeoutable</code> module). I don't want this request to cause Devise to reset the countdown until the user is logged off. How can I configure this?</p>
  
  <p>This is the code I have now:</p>
  
  <pre><code>class SessionTimeoutController &lt; ApplicationController
    before_filter :authenticate_user!
  
    # Calculates the number of seconds until the user is
    # automatically logged out due to inactivity. Unlike most
    # requests, it should not reset the timeout countdown itself.
    def check_time_until_logout
      @time_left = current_user.timeout_in
    end
  
    # Determines whether the user has been logged out due to
    # inactivity or not. Unlike most requests, it should not reset the
    # timeout countdown itself.
    def has_user_timed_out
      @has_timed_out = current_user.timedout? (Time.now)
    end
  
    # Resets the clock used to determine whether to log the user out
    # due to inactivity.
    def reset_user_clock
      # Receiving an arbitrary request from a client automatically
      # resets the Devise Timeoutable timer.
      head :ok
    end
  end
  </code></pre>
  
  <p><code>SessionTimeoutController#reset_user_clock</code> works because every time RoR receives a request from an authenticated user, <code>Timeoutable#timeout_in</code> is reset to whatever I have configured in  <code>Devise#timeout_in</code>. How do I prevent that reset in <code>check_time_until_logout</code> and <code>has_user_timed_out</code>?</p>