I was searching for an answer here and found that it an be accomplished through webstorage and cookies. However, I also came across this interesting post:
Do browsers parse javascript on every page load?
It says: "Chrome 42 introduces an advanced technique of storing a local copy of the compiled code, so that when the user returns to the page the downloading, parsing, and compiling steps can all be skipped. Across all page loads, this allows Chrome to avoid about 40% of compile time and saves precious battery on mobile devices."
Does it mean that values of variables will be persistent across page reloads? For eg. if I am storing the color selected by the user in a variable, then will that value be available in that variable after another page (on same domain) is loaded?
P.S: I could not comment there as I am a newbie and don't have enough reputation required for commenting on answers.