Fix handling of cookies for absolute domains

This commit is contained in:
Chrisliebär 2024-11-26 09:51:44 +01:00
parent f5152a4717
commit 0c6c4f2cf4

View File

@ -195,9 +195,12 @@ async function cookieStr(cookieLines) {
} }
function buildCookieLine(cookie) { function buildCookieLine(cookie) {
// 2nd argument controls subdomains, and must match leading dot in domain
let includeSubdomains = cookie.domain.startsWith('.') ? 'TRUE' : 'FALSE';
return [ return [
cookie.domain, cookie.domain,
'TRUE', includeSubdomains,
cookie.path, cookie.path,
cookie.httpOnly.toString().toUpperCase(), cookie.httpOnly.toString().toUpperCase(),
Math.trunc(cookie.expirationDate) || 0, Math.trunc(cookie.expirationDate) || 0,