简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM