kintesh / containerise

Firefox extension to automatically open websites in a container
MIT License
411 stars 55 forks source link

Container lifetime and local storege? #112

Closed Radagast closed 4 years ago

Radagast commented 4 years ago

When setting preferences for a container to Lifetime = Until the last tab is closed, what data is supposed to be removed after the last tab has been closed. For me, it's only cookies that are removed. I still see indexeddb/local storage.

Firefox 70 Linux.

LoveIsGrief commented 4 years ago

Hi @Radagast

How are you seeing and verifying that?

I haven't been able to make heads or tails from the "Storage" tab in the dev console. I can't say if anything of value is stored there.

But to answer your question: as the feature indicates the container is removed. There's no extra work done, because we rely on firefox to actually cleanup after itself when a container is destroyed. The relevant line is here.

If you have a method / proof of concept that shows a website opened in a recreated container (the IDs of the containers will be different) has access to the data that should've been deleted, there are two courses of action I see:

Radagast commented 4 years ago

How are you seeing and verifying that?

  1. Create a container for youtube

  2. Modify the preferences for the container so that when the lifetime= last tab closed

  3. Open youtube tab and confirm it's using the container

  4. Check preferences/Privacy&Security/manage Data

  5. See both Cookies and Storage have entries for youtube

  6. Delete the youtube tab

7 Check preferences/Privacy&Security/manage Data

  1. Cookies have been removed but storage remains

Same for any site that sets both cookies and storage.

stoically commented 4 years ago

Unfortunately it's a known Firefox issue that container storage isn't always removed completely, see Bugzilla 1474608. However, the data isn't accessible by the browser since the container id (cookieStoreId) changes.

Radagast commented 4 years ago

@stoically

Thanks for that. I'd noticed similar behaviour with Temporary Containers but for some reason hadn't connected the dots.

LoveIsGrief commented 4 years ago

I guess we can close this then since it's internal to firefox

rhclayto commented 3 years ago

You can configure the Cookie AutoDelete add on to clean up after closed containers, including cache, IndexedDB, cookies, localStorage, service workers, & plugin data. That way, whenever the last tab in a container is closed, CAD will clean up all the stored data from that container after a configurable delay (or immediately).