Read a cookie on page load

Thanks Alexis,

If I can describe the use case further, when an existing user makes a return visit to my website after closing the browser, I wanted to be able to know (on page load) that this is an existing user and apply some conditional logic.

Are variables in local storage automatically initialized on page load?