I recommend web storage. Example:
// Storing the data:
localStorage.setItem("variableName","Text");
// Receiving the data:
localStorage.getItem("variableName");
Just replace variable with your variable name and text with what you want to store. According to W3Schools, it's better than cookies.