diff --git a/server/ctrl/admin.go b/server/ctrl/admin.go index 0c7d3cf8..16d4f0bf 100644 --- a/server/ctrl/admin.go +++ b/server/ctrl/admin.go @@ -67,6 +67,7 @@ func AdminSessionAuthenticate(ctx App, res http.ResponseWriter, req *http.Reques Value: obfuscate, Path: COOKIE_PATH_ADMIN, MaxAge: 60*60, // valid for 1 hour + SameSite: http.SameSiteStrictMode, }) SendSuccessResult(res, true) } diff --git a/server/ctrl/session.go b/server/ctrl/session.go index 149c28fc..769f9464 100644 --- a/server/ctrl/session.go +++ b/server/ctrl/session.go @@ -80,6 +80,7 @@ func SessionAuthenticate(ctx App, res http.ResponseWriter, req *http.Request) { MaxAge: 60 * 60 * 24 * 30, Path: COOKIE_PATH, HttpOnly: true, + SameSite: http.SameSiteStrictMode, } http.SetCookie(res, &cookie) @@ -101,14 +102,14 @@ func SessionLogout(ctx App, res http.ResponseWriter, req *http.Request) { http.SetCookie(res, &http.Cookie{ Name: COOKIE_NAME_AUTH, Value: "", - Path: COOKIE_PATH, MaxAge: -1, + Path: COOKIE_PATH, }) http.SetCookie(res, &http.Cookie{ Name: COOKIE_NAME_ADMIN, Value: "", - Path: COOKIE_PATH_ADMIN, MaxAge: -1, + Path: COOKIE_PATH_ADMIN, }) SendSuccessResult(res, nil) } diff --git a/server/ctrl/share.go b/server/ctrl/share.go index 92ca9d56..f83303ee 100644 --- a/server/ctrl/share.go +++ b/server/ctrl/share.go @@ -197,6 +197,7 @@ func ShareVerifyProof(ctx App, res http.ResponseWriter, req *http.Request) { Path: COOKIE_PATH, MaxAge: 60 * 60 * 24 * 30, HttpOnly: true, + SameSite: http.SameSiteStrictMode, } http.SetCookie(res, &cookie)