mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
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:
parent
db538f6dee
commit
1f4174355c
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue