Cookies were always a bit limited so local storage is the better alternative.  It is fairly new but should work in any up-to-date browser.

You can store data permanently or for just for the time the site is open in the browser.  Create a page called local.html and put this in it:

localStorage.setItem('username', 'fred');
var storedUsername=localStorage.getItem('username');

Try it.  For temporary storage use sessionStorage in place of localStorage.

While not all browsers support local storage (only old ones will not) you would need to use both local storage and cookies.  Or just take the risk and ignore older browsers.