I am trying to use localStorage as a substitute for cookies (disable cookies) so that users can stay logged in to my site.
What I had planned so far was to save the username in localStorage and check that something was in localStorage, and if something is in localStorage, it will push the localStorage data into the PHP file via POST and click to start a new PHP session and return them to where they were.
Although I have a problem, I know that localStorage can be viewed, in which case it is possible to encrypt the data server will make sense.
But can LocalStorage data be changed? If not, it would be nice to do it, even without encryption, but obviously, if the user could change the data of the local storage, they would have access to the accounts of others, which, as you can imagine, is not very good.
I have a doubt, because JavaScript can be executed by the client in the browser, that is:
javascript:alert("hello");
Could not find out varStore localStorage name and reset value like this?
javascript:localStorage.setItem('sessionusername','superadmin');
Basically, I ask: is it possible to modify client-side HTML5 local storage data?
Cheers, Karan :)
source
share