Menu
I am trying to set a cookie on page load (popup window), and delete it when the window is closed. Below is the code I am using, the cookie is set on page load, but I can’t get it to delete.
Please could someone look at my code and tell me where I have gone wrong.
Thanks
[code=php]
<html>
<SCRIPT>
function setCookie(isName,isValue){
document.cookie = isName+”=”+isValue;
}
function Delete(isName){
document.cookie = “regUser” + “=;expires=Thu, 01-Jan-70 00:00:01 GMT”;
}
</SCRIPT>
<body onload=”setCookie(‘regUser’,’yes’)” onbeforeunload=”Delete()”;>
popup window
</body>
</html>