Intro to storing user input.
Why would a developer use local storage for a web application?
Storing the state of an application allows a website interface to recall where it left off with a user. Doing this on a server takes extra time to load and requires a user to log-in for them to be recognized. Local storage of user data in the browser bypasses these processes saving time and annoyance on the part of the user.
What information should not be stored in local storage?
Sensitive information that can be exploited since this local storage is prone to hacking.
Local storage can store what type of data? How would you convert it to that type before storing?
Local storage can only store string data. Objects and numbers can be converted to strings by using a combination of the
JSON.stringify()andJSON.parse()methods.
I’m guessing this is why I have to clear my history and all “cookies and other site data” so I can get the first time visitor discount prompt to show up again when I re-visit a page.