How to store data in the browser using JavaScript localStorage

Normally, when you set a variable, it goes away once you reload the page. What if you could store data that stays every tim...