From cb315c717b9707c1589bf490b65ace93a9e7ffd2 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Mon, 7 Mar 2022 18:39:52 +0000 Subject: [PATCH] Appease some Chrome cookie-related warnings. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3854 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/auth.js b/core/auth.js index 04fcd431..b9f6a7b4 100644 --- a/core/auth.js +++ b/core/auth.js @@ -114,7 +114,7 @@ function authHandler(request, response) { } } - var cookie = "session=" + session + "; path=/; Max-Age=604800"; + var cookie = "session=" + session + "; path=/; Max-Age=604800; Secure; SameSite=Strict"; var entry = readSession(session); if (entry && formData.return) { response.writeHead(303, {"Location": formData.return, "Set-Cookie": cookie}); @@ -165,7 +165,7 @@ function authHandler(request, response) { } } else if (request.uri == "/login/logout") { removeSession(session); - response.writeHead(303, {"Set-Cookie": "session=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT", "Location": "/login" + (request.query ? "?" + request.query : "")}); + response.writeHead(303, {"Set-Cookie": "session=; path=/; secure; SameSite=Strict; expires=Thu, 01 Jan 1970 00:00:00 GMT", "Location": "/login" + (request.query ? "?" + request.query : "")}); response.end(); } else { response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8", "Connection": "close"});