6. Set up timeout after inactivity - verachell/Simple-rails-tryout-app-using-devise GitHub Wiki

You want to be sure people aren't logged in forever just because they forgot to log out.

First, make sure :timeoutable is not commented out in app/models/user.rb then, in config/initializers/devise.rb uncomment and set appropriate value of timeout time, for example

config.timeout_in = 20.minutes

Test that this works.

Note: It wasn't clear from the official devise Wiki if this still works when :timeoutable was commented out in the initial User model at setup. In other words, is timeoutable built in such that database migrations are not needed even if timeoutable wasn't set up at the start? Don't know.

In any case, this method works fine in this situation, since we did have timeoutable set up initially in this tutorial.