Closed Bug 595542 Opened 14 years ago Closed 14 years ago

localStorage does not persist when location.protocol=="file:"

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 507361

People

(Reporter: DougL14, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 GTB7.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 GTB7.1 localStorage does not persist between loads of the same local page (i.e., when URL is like file:///C:/any.html) even in the same tab of the same Firefox session. E.g., when the following page is reloaded: <!DOCTYPE html> <html> <head> <script type="text/javascript"> function handleOnload() { var html = '<br>localStorage.getItem("key"): ' + localStorage.getItem('key'); localStorage.setItem('key','val'); html += '<br>localStorage.getItem("key"): ' + localStorage.getItem('key'); document.getElementById('id').innerHTML = html; } </script> </head> <body onload="handleOnload();"> <p id="id"> </body> </html> Reproducible: Always Steps to Reproduce: 1. Copy the above example into a file on your machine and try it. 2. 3. Actual Results: localStorage.getItem("key"): null localStorage.getItem("key"): val (even after reload -- so the data has not persisted). Expected Results: When first loaded ... localStorage.getItem("key"): null localStorage.getItem("key"): val The reloaded ... localStorage.getItem("key"): val localStorage.getItem("key"): val
Component: Developer Tools → DOM
Product: Firefox → Core
QA Contact: developer.tools → general
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.