<!DOCTYPE html>
<html lang="en-US">
<body>
<script>
var weight = "80 kg";
//one hour = 3600 = 60 * 60 * 1000= (seconds * minutes * milliseconds)
var oneHour = 3600 * 1000;
//Current Date
var now = new Date();
//Current Time in milliseconds
var time = now.getTime();
//Add One hour
time += oneHour;
//Set current time, one hour after
now.setTime(time);
document.cookie = "userweight="+weight+";expires="+now.toUTCString()+";path=/";
document.write("Cookie written, check in your browser's cookie section");
</script> </body>
</html>