Skip to content
Snippets Groups Projects
Commit 5ac55518 authored by Frédéric Guillot's avatar Frédéric Guillot
Browse files

Set SameSite cookie attribute to Strict

parent 514f518d
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ func New(name, value string, isHTTPS bool, path string) *http.Cookie { ...@@ -27,7 +27,7 @@ func New(name, value string, isHTTPS bool, path string) *http.Cookie {
Secure: isHTTPS, Secure: isHTTPS,
HttpOnly: true, HttpOnly: true,
Expires: time.Now().Add(cookieDuration * 24 * time.Hour), Expires: time.Now().Add(cookieDuration * 24 * time.Hour),
SameSite: http.SameSiteLaxMode, SameSite: http.SameSiteStrictMode,
} }
} }
...@@ -41,7 +41,7 @@ func Expired(name string, isHTTPS bool, path string) *http.Cookie { ...@@ -41,7 +41,7 @@ func Expired(name string, isHTTPS bool, path string) *http.Cookie {
HttpOnly: true, HttpOnly: true,
MaxAge: -1, MaxAge: -1,
Expires: time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC), Expires: time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC),
SameSite: http.SameSiteLaxMode, SameSite: http.SameSiteStrictMode,
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment