Add SameSite=Lax cookie attribute for better browser compatibility

Some browsers were not accepting cookies without an explicit SameSite attribute.
Added SameSite=Lax to the login cookie to ensure it works across all modern browsers.

This fixes login issues where the cookie was being set by the server but not
accepted/sent by the browser on subsequent requests.
This commit is contained in:
Claude 2025-11-05 13:31:54 +00:00
parent db538f6dee
commit 1f4174355c
No known key found for this signature in database

View file

@ -73,7 +73,8 @@ func (h *WebHandler) HandleLogin(c *gin.Context) {
return
}
// Set session cookie
// Set session cookie with explicit SameSite=Lax for better compatibility
c.SetSameSite(http.SameSiteLaxMode)
c.SetCookie("tracks_token", resp.Token, 60*60*24*7, "/", "", false, true)
// Redirect to dashboard