change cookies from any site to strict
This commit is contained in:
parent
ad0f68d705
commit
7741556dc7
1 changed files with 7 additions and 7 deletions
|
@ -48,23 +48,23 @@ func saveUserSettings(w http.ResponseWriter, settings UserSettings) {
|
||||||
Path: "/",
|
Path: "/",
|
||||||
Expires: expiration, // Expiration time needs to be set otherwise it will expire immediately
|
Expires: expiration, // Expiration time needs to be set otherwise it will expire immediately
|
||||||
Secure: true, // Ensure cookie is sent over HTTPS only
|
Secure: true, // Ensure cookie is sent over HTTPS only
|
||||||
SameSite: http.SameSiteNoneMode, // Set SameSite to None
|
SameSite: http.SameSiteStrictMode,
|
||||||
})
|
})
|
||||||
http.SetCookie(w, &http.Cookie{
|
http.SetCookie(w, &http.Cookie{
|
||||||
Name: "language",
|
Name: "language",
|
||||||
Value: settings.Language,
|
Value: settings.Language,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
Secure: true, // Ensure cookie is sent over HTTPS only
|
Secure: true,
|
||||||
SameSite: http.SameSiteNoneMode, // Set SameSite to None
|
SameSite: http.SameSiteStrictMode,
|
||||||
})
|
})
|
||||||
http.SetCookie(w, &http.Cookie{
|
http.SetCookie(w, &http.Cookie{
|
||||||
Name: "safe",
|
Name: "safe",
|
||||||
Value: settings.SafeSearch,
|
Value: settings.SafeSearch,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
Expires: expiration,
|
Expires: expiration,
|
||||||
Secure: true, // Ensure cookie is sent over HTTPS only
|
Secure: true,
|
||||||
SameSite: http.SameSiteNoneMode, // Set SameSite to None
|
SameSite: http.SameSiteStrictMode,
|
||||||
})
|
})
|
||||||
|
|
||||||
printDebug("settings saved: %v", settings)
|
printDebug("settings saved: %v", settings)
|
||||||
|
|
Loading…
Add table
Reference in a new issue