检查了几个问题之后:
rails 3.1, devise gem, :timeoutable is not working, why?
devise config.timeout_in not working
How to configure time out using devise?
我已将用户模型设置为:timeoutable
class User < ActiveRecord::Base
devise :rememberable, :demo_authenticatable, :api_authenticatable,:registerable,
:recoverable, :trackable, :validatable, :confirmable, :lockable, :timeoutable
我还在devise.rb文件中取消了timeout_in行
config.timeout_in = 1.minutes
我也尝试在用户模型中设置timeout_in属性,但我一直在登录
任何线索?
提前致谢,欢呼!
答案 0 :(得分:2)
如果您希望在刷新时向您显示登录页面,请从模型中删除超时部分并将其放入devise.rb NOT development.rb&amp;重启rails服务器。
config.timeout_in = 1.hour