config/initializers/devise.rb
配置 config.timeout_in
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
或者在 model 里配置。类似于这样..
devise :timeoutable, :timeout_in => 30.minutes