Auf Webserver speichern

Eine alternative zu Cookie könnte das hier sein

<html>
<body>
 
<h2>Store and retrieve data from local storage.</h2>
 
<p id="demo"></p>
 
<script>
var myObj, myJSON, text, obj;
 
// Storing data:
myObj = { name: "John", age: 31, city: "New York" };
myJSON = JSON.stringify(myObj);
localStorage.setItem("testJSON", myJSON);
 
// Retrieving data:
text = localStorage.getItem("testJSON");
obj = JSON.parse(text);
document.getElementById("demo").innerHTML = obj.age;
</script>
 
</body>
</html>