borisbabic / browser_cookie3

This is a fork of browser_cookie
GNU Lesser General Public License v3.0
821 stars 143 forks source link

Firefox cookies from given container in Multi-Account Containers #205

Open rez-spb opened 4 months ago

rez-spb commented 4 months ago

How does this module handle Multi-Account Containers in Firefox?

From what I've read (http://justsolve.archiveteam.org/wiki/Firefox_cookie_database), FF introduced originAttributes column since August, 2022, which I see present in SQLite DB. Example value for this DB column: ^userContextId=1&firstPartyDomain=somedomain.com I have several containers with different userContextId used for one site/host but with different credentials and cookies.

Is it possible for this module to address only cookies in particular container? Currently it looks like it takes arbitrary one and my cookies are a mess: some fields are taken from one container, others may be from another, and it seems that there's no way to separate them due to internal CookieJar object having no originAttributes field (searched in code for this, didn't find it).

Usecase:

Actual result: Get one CookieJar object with randomly selected container and fields.

Expected result: Get 3 objects with IDs for each container (including default) totally separated from one another with proper cookies for each.

Ability to select from returned objects by ID would also be much appreciated. Hope I didn't miss something, because there's little documentation so I had to to try and err on this one.

rez-spb commented 4 months ago

I have solved this myself for my usecase. Is it OK if I fork and send pull request or is this functionality not important enough? Just asking.

Vetches commented 1 month ago

Hi @rez-spb! Can you share your solution for extracting cookies from Firefox containers? I haven't been able to find a way to do so myself as yet! Thank you so much!

NotDday commented 1 week ago

I also have the same issue