I'm moving this from an issue on the Devise repo as I don't know that it's actually a bug yet. I'm hoping someone can help me understand why my devise sessions are timing out so quickly.
Environment
Ruby 2.7.2
Rails 6.1
Devise 4.7.3
Current behavior
My goal was to persist sessions for around 30 days before requiring the user to login again. With stock devise, no inviteable, I was seeing properly persisted session times on my desktop browsers but short sessions, (expiring in days, sometimes hours) on mobile devises. I realized maybe I needed to be using :timeoutable
I installed :timeoutable
against a User model, enabled and set the config.timeout_in
in 29.days in devise.rb. Except now with :timeoutable
configured instead of longer 29.day sessions, all browser sessions are closing out after around hour or two.
Expected behavior
Session should persist for 29.days before requiring the user to login again.
I feel like I'm missing something obvious but I can't find it. Is :timeoutable
not the right way to achieve this?
Update:
This issue resolved itself after moving my application from a subdomain to the root domain. This isn't really any answer but I wanted to add it here for context. Beyond that I think the next best answer would have been to adjust the rails native cookie store.
Regardless, I'm still unconvinced timeoutable is working properly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…