From e7b6dc6ed8f252e38dca3322545c6ad402ed9860 Mon Sep 17 00:00:00 2001 From: Tom Levy Date: Sat, 30 Dec 2023 01:58:52 +1300 Subject: [PATCH] Extend duration of 'remember me' cookie Previously, users would have to sign in every 2 weeks (unless they configure their web browser to restore session cookies on restart). Increase the duration to 1 month, and also enable the `extend_remember_period` feature so that the cookie will be automatically renewed. --- config/initializers/devise.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 0b9c8d07..c9a81b89 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -100,10 +100,10 @@ # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks + config.remember_for = 1.month # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false + config.extend_remember_period = true # Options to be passed to the created cookie. For instance, you can set # :secure => true in order to force SSL only cookies.