How does window.localstorage persist?

Arne Garvander 81 Reputation points
2022-05-19T17:50:04.837+00:00

My favorite website is using windows.localStorage. When I close the browser my data disappear. How can persist my data in Microsoft Edge.

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,114 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 47,716 Reputation points
    2022-05-19T19:46:41.837+00:00

    Refer to the official documentation here on available storage options that web apps can use.

    Local storage persists across browser sessions. It is stored in the user's cache and remains there until it is cleaned up by the user or via the web app.

    If the data is not persisting across browser sessions then it is using session storage, not local storage, or the web app is wiping the data. This is common for cached data the site might use. I guess it could also happen if you were running an in private window or something similar as well.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Arne Garvander 81 Reputation points
    2022-05-19T20:01:29.383+00:00

    Local storage persists across browser sessions in Chrome but not in Edge.
    Is that a bug or a feature?


  2. Arne Garvander 81 Reputation points
    2022-05-19T20:14:49.433+00:00

    It works fine in Firefox and Chrome, but broken in Edge.
    Sometimes a browser has a feature delete data on exit. I may accidentially turn on such a thing. No I don't own this site. I am trying to convince customer support that they have a problem.

    0 comments No comments