Skip to content

A self-hosted dashboard that puts all your feeds in one place

Add expiration to theme cookie

Svilen Markov40ae263248a7
diff --git a/internal/glance/theme.go b/internal/glance/theme.go
index a3e26d4..07f3921 100644
--- a/internal/glance/theme.go
+++ b/internal/glance/theme.go
@@ -4,6 +4,7 @@ import (
"fmt"
"html/template"
"net/http"
+ "time"
)
var (
@@ -29,6 +30,7 @@ func (a *application) handleThemeChangeRequest(w http.ResponseWriter, r *http.Re
Value: themeKey,
Path: a.Config.Server.BaseURL + "/",
SameSite: http.SameSiteLaxMode,
+ Expires: time.Now().Add(2 * 365 * 24 * time.Hour),
})
w.Header().Set("Content-Type", "text/css")