From ea12e6bc089e186dd6b948fd5a867635991c0e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chrislieb=C3=A4r?= <11184804+chrisliebaer@users.noreply.github.com> Date: Tue, 28 Jan 2025 04:23:00 +0100 Subject: [PATCH] Fix handling of cookies for absolute domains (#50) --- extension/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/background.js b/extension/background.js index 5ec1506..b220dfb 100644 --- a/extension/background.js +++ b/extension/background.js @@ -195,9 +195,12 @@ async function cookieStr(cookieLines) { } function buildCookieLine(cookie) { + // 2nd argument controls subdomains, and must match leading dot in domain + let includeSubdomains = cookie.domain.startsWith('.') ? 'TRUE' : 'FALSE'; + return [ cookie.domain, - 'TRUE', + includeSubdomains, cookie.path, cookie.httpOnly.toString().toUpperCase(), Math.trunc(cookie.expirationDate) || 0,