question

ArneGarvander-2255 avatar image
0 Votes"
ArneGarvander-2255 asked ArneGarvander-2255 answered

How does window.localstorage persist?

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

ms-edge
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArneGarvander-2255 avatar image
0 Votes"
ArneGarvander-2255 answered cooldadtx commented

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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The behavior of web storage is defined by the standards, not the browsers. Without an example of this issue it is hard to say but using some test sites I can see the local storage being persisted across sessions as far as I can tell. It has been supported in Edge since v12.

If this is your own site then you should check your JS code. If this is another site then perhaps the site is doing something. You can report the problem to MS if you believe it to be a bug in Edge but they will need a test site to confirm. Also ensure that you don't have any odd settings or permissions configured such as running as private window or via IE mode.

0 Votes 0 ·
ArneGarvander-2255 avatar image
0 Votes"
ArneGarvander-2255 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.