I think you will have to do this manually, since the expire_after option is not used in the active record store. Therefore, as part of your (I assume) before the filter, you should do this:
def authenticate if session[:logged_in] reset_session if session[:last_seen] < 2.minutes.ago session[:last_seen] = Time.now else ... authenticate session[:last_seen] = Time.now end end
Obviously, this is not complete, but this should give you the basic idea.
UPDATE
Functionality seems to be present on rails since version 2.3. I found the appropriate code here . This is AbstractStore, which should serve as the base class for all derivatives. So, as dadooda suggests, the following should work:
Some::Application.config.session_store :active_record_store, { expire_after: 24.hours, }
moritz May 2 '11 at 18:40 2011-05-02 18:40
source share