Closed Bug 1543146 Opened 6 years ago Closed 1 year ago

Local storage resets to previous state when "Delete cookies and site data when Firefox is closed" is set

Categories

(Core :: Storage: localStorage & sessionStorage, defect, P3)

66 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: guido.knips, Unassigned)

Details

(Whiteboard: dom-lws-bugdash-triage)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Steps to reproduce:

  1. uncheck "Local storage resets to precious state when "Delete cookies and site data when Firefox is closed" is set" in the privacy settings
  2. open a site S that uses local storage and change the local storage
  3. close firefox, start firefox again
  4. check "Local storage resets to precious state when "Delete cookies and site data when Firefox is closed" is set" in the privacy settings
  5. change some local storage (e.g. delete it or change it) on the previously visited site S
  6. close firefox, start firefox again
  7. visit site S again

Actual results:

Site S still has the local storage from step 2.

Expected results:

The local storage of site S is empty (or the initial local storage of site S).

Thanks for the bug, however the steps are a bit confusing.
Can you please clarify the steps to reproduce:

  1. uncheck "Local storage resets to precious state when "Delete cookies and site data when Firefox is closed" is set" in the privacy settings

where do you do this: " uncheck "Local storage resets to precious state "?

  1. check "Local storage resets to precious state when "Delete cookies and site data when Firefox is closed" is set" in the privacy settings

same question as above: where is or what do you mean by the "Local storage resets to precious state " ?

Flags: needinfo?(guido.knips)

Resolving this issue as incomplete for the time being.
Please reopen this issue once the additional information required in comment1 is provided.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE

Sorry for the delay, I was away from work for some time.
I don't know how that mess of a sentence in step 1 and for happened. I probably tried to copy the line "Delete cookies and site data when Firefox is closed" from the settings, did not manage to copy it and pasted whatever was in the buffer before.

Step 1: uncheck "Delete cookies and site data when Firefox is closed" in the privacy settings

Step 4: check "Delete cookies and site data when Firefox is closed" in the privacy settings

I will update the original description

Flags: needinfo?(guido.knips)

Sorry for the delay, I was away from work for some time.
I don't know how that mess of a sentence in step 1 and for happened. I probably tried to copy the line "Delete cookies and site data when Firefox is closed" from the settings, did not manage to copy it and pasted whatever was in the buffer before.

Step 1: uncheck "Delete cookies and site data when Firefox is closed" in the privacy settings
Step 4: check "Delete cookies and site data when Firefox is closed" in the privacy settings

So the full reproduction steps are:

  1. uncheck uncheck "Delete cookies and site data when Firefox is closed" in the privacy settings
  2. open a site S that uses local storage and change the local storage
  3. close firefox, start firefox again
  4. check "Local storage resets to precious state when "Delete cookies and site data when Firefox is closed" is set" in the privacy settings
  5. change some local storage (e.g. delete it or change it) on the previously visited site S
  6. close firefox, start firefox again
  7. visit site S again
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Component: Untriaged → Preferences
Component: Preferences → Data Sanitization
Product: Firefox → Toolkit

The priority flag is not set for this bug.
:johannh, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jhofmann)

I haven't really found the time to debug this, maybe the storage team can take a look, as it's probably on their turf anyway.

Component: Data Sanitization → Storage: localStorage & sessionStorage
Flags: needinfo?(jhofmann)
Product: Toolkit → Core
Priority: -- → P3

This is definitely how legacy LocalStorage works. It bootstraps the session data from the persisted data, and the session data is then in-memory only with no writes ever made to disk. It's not clear why that decision was made; maybe consistency with cookies (which may have subsequently changed). It's definitely not intuitive. The good news is that clear operations will do the expected thing and data won't return.

The LocalStorage Next Gen implementation that's enabled on nightly and early beta doesn't have this problem, using the same storage for both session-only and persistent storage. The difference is that Sanitizer.jsm tells QutoaManager to wipe all session-persistence storages at shutdown.

The primary issue with attempting to alter the legacy LocalStorage implementation here is that the act of switching from persistent to session-only would presumably not want to actually wipe the storage at the moment of the switch.

Severity: normal → S3

Bug 1599979 should have fixed that on all channels.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago1 year ago
Resolution: --- → WORKSFORME
Whiteboard: dom-lws-bugdash-triage
You need to log in before you can comment on or make changes to this bug.