localStorage doesn't clear it's memory mapping when clear data is used

Confirmed Issue #2894326 • Assigned to Shawn P.

Details

Created
May 18, 2015
Privacy
This issue is public.
Found in build #
10.10113
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

load this page in Edge

https://jsfiddle.net/kL9jzbgr/2/](https://jsfiddle.net/kL9jzbgr/2/)[https://jsfiddle.net/kL9jzbgr/2/](https://jsfiddle.net/kL9jzbgr/2/)

or create a page with this markup:

<div style="text-align:right; width:300px;">
    Key:<input id="key" />
    <br />
    Value:<input id="value" />
    <br />
    <button id="readit">read it</button>
    <button id="writeit">write it</button>
    <button id="removeit">remove it</button>
</div>

And this JS:

var keyInput = document.getElementById(“key”);
var valueInput = document.getElementById(“value”);
var readit = document.getElementById(“readit”);
var writeit = document.getElementById(“writeit”);
var removeit = document.getElementById(“removeit”);
readit.addEventListener("click", function () {
    var theKey = keyInput.value;
    if (theKey) {
        valueInput.value = localStorage.getItem(theKey);
    } else {
        showError();
    }
});
writeit.addEventListener("click", function () {
    var theKey = keyInput.value;
    if (theKey) {
        localStorage.setItem(theKey, valueInput.value);
    } else {
        showError();
    }
});
removeit.addEventListener("click", function () {
    var theKey = keyInput.value;
    if (theKey) {
        localStorage.removeItem(theKey);
        valueInput.value = localStorage.getItem(theKey);
    } else {
        showError();
    }
});
function showError() {
    alert(“you must enter a key”);
    keyInput.focus();
}

try reading/writing/removing key/value pairs using the buttons displayed.

clear the cookies.
without reopening the browser or navigating the page, try any of the operations again.

Expected: Values previously set are gone, but it is possible to write and subsequently read new values, and once written removed.

Actual: cannot write new values, remove old values, and reading may return results, other than those set, or may return a value you tried to remove, or it may not do nothing.

If you have the F12 console visible, you can see errors like this printed to the screen:

SCRIPT1018: Illegal operation attempted on a registry key that has been marked for deletion.
show (40,9)

Any page that relies on local storage will probably fail without a browser restart after clearing cookies.

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Krunal S.”

      Changed Status to “Won’t fix”

      Changed Assigned To to “Krunal S.”

      Changed Status from “Won’t fix”

      Changed Assigned To from “Krunal S.” to “Shawn P.”

      Changed Status to “Confirmed”

      Changed Steps to Reproduce

      Changed Title from “localStorage for IE and spartan doesn't clear it's memory mapping when clear data is used” to “localStorage doesn't clear it's memory mapping when clear data is used”

    You need to sign in to your Microsoft account to add a comment.

    Sign in