From 080933dd351272bd2d772d32df7315a536b0cea5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 19 Dec 2021 17:14:32 +0100 Subject: Set cookie path to root directory. --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 2667ad1..8d4c24b 100644 --- a/server.js +++ b/server.js @@ -62,12 +62,12 @@ function login_cookie(req) { function login_insert(res, user_id) { let sid = login_sql_insert.get(user_id); - res.setHeader('Set-Cookie', 'login=' + sid + '; Max-Age=2419200'); + res.setHeader('Set-Cookie', 'login=' + sid + '; Path=/; Max-Age=2419200'); } function login_touch(res, sid) { if (login_sql_touch.run(sid).changes === 1) - res.setHeader('Set-Cookie', 'login=' + sid + '; Max-Age=2419200'); + res.setHeader('Set-Cookie', 'login=' + sid + '; Path=/; Max-Age=2419200'); } function login_delete(res, sid) { -- cgit v1.2.3