From 97af57a41c20ac9ccc3aff7999f3b1162410ddbe Mon Sep 17 00:00:00 2001
From: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Date: Sun, 21 Jul 2024 14:58:53 +0100
Subject: [PATCH] chore: Set secure and same-site attributes for session cookie

---
 api/endpoints.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/api/endpoints.go b/api/endpoints.go
index d7e6cb6..8f88a64 100644
--- a/api/endpoints.go
+++ b/api/endpoints.go
@@ -626,9 +626,12 @@ func handleProviderCallback(w http.ResponseWriter, r *http.Request) {
 		}
 
 		http.SetCookie(w, &http.Cookie{
-			Name:  "pokerogue_sessionId",
-			Value: sessionToken,
-			Path:  "/",
+			Name:     "pokerogue_sessionId",
+			Value:    sessionToken,
+			Path:     "/",
+			Secure:   true,
+			SameSite: http.SameSiteStrictMode,
+			Domain:   "beta.pokerogue.net",
 		})
 	}