Skip to content

Commit 59d053d

Browse files
author
gamebeaker
committed
set_cookie_domain_to_highest_domain
1 parent a914510 commit 59d053d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugin/js/HttpClient.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ class HttpClient {
217217
// get all cookie from the site which use the partitionKey (e.g. cloudflare)
218218
//keep old code for reference in case it changes again
219219
//let cookies = await chrome.cookies.getAll({partitionKey: {topLevelSite: topLevelSite}});
220-
let cookies = await chrome.cookies.getAll({domain: parsedUrl.hostname.replace(/^www./, ""),partitionKey: {}});
220+
221+
//set domain to the highest level from the website as all subdomains are included #1447 #1445
222+
let urlparts = parsedUrl.hostname.split(".");
223+
let cookies = await chrome.cookies.getAll({domain: urlparts[urlparts.length-2]+"."+urlparts[urlparts.length-1],partitionKey: {}});
221224

222225
//create new cookies for the site without the partitionKey
223226
//cookies without the partitionKey get sent with fetch

0 commit comments

Comments
 (0)