summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-09-02 23:14:40 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-09-02 23:14:40 +0000
commit74bf58335d3542d88b32d447b47342a76f5e5449 (patch)
tree640d073c09156fe346db9faf32817ed34261a82e /cmd
parent0642dab358ac7c84d56314277d4664043598dcc5 (diff)
Extend session lifetime and idle timeout from 7 days / 24h to 1 year
Single-user personal server -- there's no one else's session at risk from staying logged in, so the short expiry was just friction. The 24h idle timeout was the more disruptive of the two in practice: a day of not opening the dashboard is a normal gap, not "abandoned," and was forcing a re-login well before the 7-day Lifetime ever mattered. Setting IdleTimeout = SessionLifetime rather than a separate shorter value collapses this to one real limit instead of two overlapping ones that could reproduce the same complaint later (e.g. a few weeks away). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dashboard/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go
index c9e1078..2c75313 100644
--- a/cmd/dashboard/main.go
+++ b/cmd/dashboard/main.go
@@ -61,7 +61,10 @@ func main() {
sessionManager := scs.New()
sessionManager.Store = sqlite3store.New(db.DB())
sessionManager.Lifetime = config.SessionLifetime
- sessionManager.IdleTimeout = 24 * time.Hour // Extend session on activity
+ // Matches SessionLifetime rather than the previous 24h -- a day of not opening
+ // the dashboard (a normal gap, not "abandoned") was logging out a single user
+ // on their own device well before the 1-year Lifetime ever came into play.
+ sessionManager.IdleTimeout = config.SessionLifetime
sessionManager.Cookie.Persist = true
sessionManager.Cookie.Secure = !cfg.Debug
sessionManager.Cookie.SameSite = http.SameSiteLaxMode