reading-notes

Local Storage and How To Use It On Websites

A developer would use local storage for a web application because in essence, it is like holding and keeping the key to a user’s computer computer when they access your web application, and when they open it, you unlock it for them.

You hold the state of the application for when they last visited on your local storage and can restore it when they visit again. Also, it is faster once the data is cached to local storage rather then pulling the data from a server side client everytime.

Personally Identifiable Information, authentication tokens, user locations and API keys should never be stored in local storage.

Local storage can only store strings in different keys. To convert the strings back to objects you can use JSON.stringify() and JSON.parse() methods.

References

Local Storage And How To Use It On Websites

Things I want to know more about