Set cookie attribute SameSite to strict mode
This commit is contained in:
parent
6137b401ee
commit
88e81d4d80
1 changed files with 2 additions and 0 deletions
|
@ -27,6 +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.SameSiteStrictMode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +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.SameSiteStrictMode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue