localStorage
is the client's memory, which is free to be consulted by the client user. Keep in mind that the information you save there will be visible to anyone who knows how to enter the browser console, so you should not save sensitive information such as passwords or credit card numbers there, at least not before having encrypted them on the side of the browser. server.
Remember that on the web, for everything you want the client to do, you must provide the source code (if you do not want to use applets
), therefore, anyone who knows how to press CTRL+U
will be able to read your logic. Learn to separate the tasks of your site and evaluate if the information is sensitive or not and if what you are serving in the client is critical for the operation.