Rails 是否提供默认会话超时持续时间?如果是,它在哪里指定? [英] Does Rails provide default session time-out duration? If yes, where is it specified?
问题描述
我已经知道如何在 rails 应用程序中设置到期时间,这在网络上已经有很好的记录.但我想知道的是 Rails 中会话到期的默认持续时间是多少,如果有,在哪里可以找到?
I already know how to set expiry time duration in rails app, which has been documented very well on web. But what I want to know is what is the default time duration for session expiry in rails and if there is one, where to find it?
推荐答案
Rails 没有默认的过期时间.session_store的方法定义似乎只有一个默认:
Rails doesn't have a default expiration time. The method definition for session_store seems to have only one default:
在第 32 行 @session_store = :cookie_store
默认情况下其他配置不存在.因此,:expire_after
没有设置,Rails 的会话没有过期时间除非你为它设置一个值.
By default the other configurations are non existent. Therefore, :expire_after
is not set and Rails' sessions don't have expiration time unless you set a value for it.
这篇关于Rails 是否提供默认会话超时持续时间?如果是,它在哪里指定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!