Write a JavaScript program to create a persistent cookie.
<html>
<head>
<title>Persistent Cookie Example</title>
<script>
function WriteCookie()
{
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth() + 1);
with (document.CookieWriter)
{
document.cookie = "ItemName=" + "; expires=" + expireDate.toGMTString() + ";";
alert("Cookie Written");
}
}
</script>
</head>
<body>
<form name="CookieWriter" action="" >
Enter the item name:<input type="text" name="customer" onchange="WriteCookie()"/>
</form>
</body>
</html>
