You can use local storage. Some functions to make it handy:
function enableLSvars() {
if (typeof(Storage) === "undefined") throw { message : 'Local storage must be enabled to use this.' }
this.LS_getValue = function (key, def) { return localStorage[key] || def; }
this.LS_setValue = function (key, value) { return localStorage[key] = value; }
this.LS_deleteValue = function (key) { return delete localStorage[key]; }
}
In page where you want to save a variable call for:
LS_setValue(yourVar, "yourValue");
To retrieve the value later, use:
LS_getValue(yourVar);