Rob--W / cookie-manager

Cookie Manager for Firefox (Desktop/Android), Chrome. Supports viewing and editing of cookies and private cookies.
Mozilla Public License 2.0
105 stars 24 forks source link

Partition key is absent on export of cookies from firefox #61

Closed igvk closed 3 months ago

igvk commented 3 months ago

When there are partitioned cookies, and their export to file (or text) is selected, they are exported with absent partition key. It either null, or empty (consists of {} braces only, without value). Example:

 {
  "name": "cookie",
  "value": "",
  "domain": "domain.com",
  "hostOnly": true,
  "path": "/",
  "secure": true,
  "httpOnly": false,
  "session": false,
  "storeId": "firefox-container",
  "sameSite": "no_restriction",
  "firstPartyDomain": "",
  "partitionKey": {}
 }
Rob--W commented 3 months ago

Thanks for your report! I can reproduce it, e.g. by visiting https://example.com and running new Image().src = "https://stackoverflow.com/" from the console.

While the UI displays the partitioned cookies, the exported cookie lacks the expected topLevelSite key.

This happens because I'm explicitly listing the set of permitted keys as part of JSON serialization, and apparently nested objects are also subjected to the list of permitted keys:

https://github.com/Rob--W/cookie-manager/blob/c584e26921d90d81c082225d34183ee9b2582cdc/cookie-manager.js#L948

I'll work on a fix soon.

Rob--W commented 3 months ago

Fixed in version 1.8.

igvk commented 3 months ago

That's great you fixed it!