Add expiration to theme cookie

This commit is contained in:
Svilen Markov 2025-05-05 13:46:36 +01:00
parent bf97829814
commit 40ae263248

View File

@ -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")