Does the localStorage get cleared when working with npm live-server?

293 Views Asked by At

I am currently working on a basic JS application that requires the usage of DOM storage or localStorage. In order to auto-save my changes, I incorporated the npm live-server.

After I shut down the live-server, I notice that the localStorage gets cleared. Can you help me understand how this happens under the hood?

1

There are 1 best solutions below

1
Marten Steins On BEST ANSWER

localStorage is stored on the client side not on the server side, so each browser decides. Read at MDN: localStorage