I have recently taken on a concept new to me in Web Development: cookies.
I understand that when you assign document.cookie a value, you are essentially creating a string.
However, when I run this simple code:
<!DOCTYPE html>
<html>
<head>
</head>
<body onLoad="makeCookie()">
<script>
function makeCookie(){
document.cookie = "value=4; pi=3.14"
alert(document.cookie);
}
</script>
</body>
</html>
It alerts "value=4" instead of the "value=4; pi=3.14;" that I want it to alert.
How can I fix this, or, are there any easier alternatives to storing data even when the user leaves the page in JavaScript?