From bda783c24f52bb3d028b861c255a9f2f1766852c Mon Sep 17 00:00:00 2001 From: Amree Zaid Date: Sun, 13 Oct 2024 19:27:06 +0800 Subject: [PATCH] Fix short lived session for good --- config/application.rb | 4 ++++ config/initializers/devise.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/config/application.rb b/config/application.rb index d48fd98..fe120e5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,5 +34,9 @@ class Application < Rails::Application config.exceptions_app = ->(env) { ErrorsController.action(:show).call(env) } + + config.session_store :cookie_store, + key: "petakopi_session", + expire_after: 1.month end end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index fcffcbb..41fa306 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -317,4 +317,6 @@ Devise::SessionsController.layout "application_full" Devise::RegistrationsController.layout "application_full" end + + config.remember_for = 1.year end