diff --git a/app.rb b/app.rb index c3ddc02..9616a93 100644 --- a/app.rb +++ b/app.rb @@ -80,7 +80,12 @@ module Maptool # docs/deployment.adoc). Falls back to a random one so the app still # loads locally/in CI without it set; that fallback just means sessions # don't survive a restart there, which is fine outside production. + # expire_after: without it the cookie is a browser-session one, which + # Android drops whenever it kills the browser/PWA — a fresh Gitea + # login + MFA every time on the tablet. Counted from login (only the + # login paths write the cookie, see SkipSessionWrite). set :sessions, httponly: true, secure: production?, same_site: :lax, + expire_after: 90 * 24 * 3600, secret: ENV.fetch("SESSION_SECRET") { SecureRandom.hex(32) } use SkipSessionWrite