By dafault, web applications are stateless, so data from a user’s input don’t persist when they navigate to another page or refresh or shut down and reload the application. A developer can use a web application to “remember” where the user left off, like savedata in a video game.
Sensitve user data should not be stored in local storage. Local storage should also only be used for storing small amounts of data.
Local storage can store string data in key/value pairs. There are workarounds to get around the key/value pair limitation, but not all browsers support every workaround.
To convert stored data from string
back into a desired type, we’d need to “coerce” it back with parseInt() for example.
“The Past, Present, and Future of Local Storage for Web Applications