Closed Bug 886832 Opened 12 years ago Closed 7 years ago

localstorage not deleted when closed even though "[Privacy - Cookies] Keep until I close Firefox" is enabled

Categories

(Firefox :: Bookmarks & History, defect)

21 Branch
x86_64
Windows 7
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: f201052, Unassigned, Mentored)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release) Build ID: 20130511120803 Steps to reproduce: Set: Tools > Options > Privacy > History > Custom Set: Tools > Options > Privacy > History > Keep until: I close Firefox Visit a site that saves data to the DOM localstorage Exit Firefox Actual results: localstorage was not cleared Expected results: localstorage should have been cleared because it is used to store cookies too (but truly invisible and much more persistent). Mozilla treats Flash local storage as cookies too, as evidenced by fixed bug 625496. localstorage should be treated the same way (or at least provide a setting for this treatment).
Blocks: 625496
Component: Untriaged → Private Browsing
This seems like a pretty reasonable request to me. We'll need to add a method to nsIDOMStorageManager (http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/storage/nsIDOMStorageManager.idl) to clear all DOM storage entries, implement it in DOMStorageManager (http://mxr.mozilla.org/mozilla-central/source/dom/src/storage/DOMStorageManager.cpp), and call it from sanitize.js from the cookie block (http://mxr.mozilla.org/mozilla-central/source/browser/base/content/sanitize.js).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [mentor=jdm]
Assignee: nobody → allamsetty.anup
It appears that Google Chrome has had this feature for a long time. Competition is beating us...
Assignee: allamsetty.anup → nobody
Severity: normal → major
I started working on this bug, using Josh's instructions as guidelines, but I found the behaviour in this area to be a bit quirky: - Set localStorage to some value A while cookies are kept "until they expire" - Restart Firefox - Change cookie behaviour to "until I close Firefox" - Restart again - Set the same localStorage scope/key to a different value B - Restart again - Read out localStorage at that scope/key: Firefox returned A (and B really never entered webappsstore.sqlite) I could reproduce this behaviour on Firefox 23 and Nightly as of yesterday. If this is actually the right behaviour, maybe the only unexpected part is that Firefox keeps the old values around? John: could you please check that your testcase isn't affected by pre-existing localStorage data? (just so we know if we see the same behaviour)
Patrick, thanks for starting to work on that. Based on my experience with Firefox, as a user, I think that might be an expected and intended behavior. Cookies that are existing before a cleaning option is applied are somehow "exempted" from the cleaning options. I might be wrong though. You should check some source code / design docs to determine if it's a bug. Nonetheless, this should not stop you from implementing localStorage cleaning on exit. Thanks.
Hi, I want to work on this bug. So can you please assign this bug to me. Thanks in advance, Regards.
Assignee: nobody → allamsetty.anup
Status: NEW → ASSIGNED
Assignee: allamsetty.anup → nobody
Mentor: josh
Whiteboard: [mentor=jdm]
Was this fixed by bug 1184973?
Flags: needinfo?(michael)
(In reply to Allan Gardner (:Mathnerd314) from comment #6) > Was this fixed by bug 1184973? I don't think that that bug changed the behaviour of LocalStorage wrt its interaction with the cookie preference, rather just standardizing the code path which it used, but I do think that there is code right now which makes localStorage not survive sessions while the pref is set. Someone should quickly test to make sure that this bug no longer reproduces, then we can close it.
Flags: needinfo?(michael)
(In reply to John Schimanski from comment #0) > Set: Tools > Options > Privacy > History > Custom > Set: Tools > Options > Privacy > History > Keep until: I close Firefox > Visit a site that saves data to the DOM localstorage (In reply to Andrew Overholt [:overholt] from comment #8) > https://mdn.github.io/dom-examples/web-storage/) Now the localstorage is cleared (the changes on the above page don't persist) even if I just close/reopen the tab in the same session. 55.0a1 (2017-06-07) (32-bit), Win 10 x64.
Keywords: qawanted
Confirm this is fixed; moving to History component for posterity.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Component: Private Browsing → Bookmarks & History
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.