bug fixes #10

Merged
partisan merged 5 commits from work into main 2024-08-21 11:08:32 +00:00
Showing only changes of commit 32e94d1c2f - Show all commits

View file

@ -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)