From b43d2078475eb9d5035b7d3adbc2050047e3b823 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Wed, 28 Sep 2022 00:41:04 +1000 Subject: [PATCH] Make cookie apply to all subdomains --- src/scripts/hcaptcha.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/hcaptcha.lua b/src/scripts/hcaptcha.lua index 8c76e08..5328969 100644 --- a/src/scripts/hcaptcha.lua +++ b/src/scripts/hcaptcha.lua @@ -267,8 +267,9 @@ function _M.view(applet) applet:add_header( "set-cookie", string.format( - "z_ddos_captcha=%s; Expires=Thu, 31-Dec-37 23:55:55 GMT; Path=/; SameSite=Strict;%s", + "z_ddos_captcha=%s; Expires=Thu, 31-Dec-37 23:55:55 GMT; Path=/; Domain=.%s; SameSite=Strict;%s", combined_cookie, + applet.headers['host'][0], secure_cookie_flag ) ) @@ -312,8 +313,9 @@ function _M.view(applet) applet:add_header( "set-cookie", string.format( - "z_ddos_pow=%s; Expires=Thu, 31-Dec-37 23:55:55 GMT; Path=/; SameSite=Strict;%s", + "z_ddos_pow=%s; Expires=Thu, 31-Dec-37 23:55:55 GMT; Path=/; Domain=.%s; SameSite=Strict;%s", combined_cookie, + applet.headers['host'][0], secure_cookie_flag ) )