kimberlyhello
09-05-2007, 01:45 AM
I made a javascript that sets a cookie by the name "keyword".
Here is the script I am trying to make work. The button is supposed to delete/rewrite the cookie...but it's not working.
I should mention that the cookie was written on a different page then the button Im using to delete the cookie. Although both use the same domain name.
<html>
<head>
<title></title>
<script type="text/javascript">
function delete_cookie ( cookie_name )
{
var cookie_date = new Date ( ); // current date & time
cookie_date.setTime ( cookie_date.getTime() - 1 );
document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
</script>
</head>
<body>
<p align="center"><input type="button" value="Delete Cookie" onclick="delete_cookie(keyword)"></p>
<div align="center"></div>
</body>
</html>
Thank to all that help me.
Here is the script I am trying to make work. The button is supposed to delete/rewrite the cookie...but it's not working.
I should mention that the cookie was written on a different page then the button Im using to delete the cookie. Although both use the same domain name.
<html>
<head>
<title></title>
<script type="text/javascript">
function delete_cookie ( cookie_name )
{
var cookie_date = new Date ( ); // current date & time
cookie_date.setTime ( cookie_date.getTime() - 1 );
document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
</script>
</head>
<body>
<p align="center"><input type="button" value="Delete Cookie" onclick="delete_cookie(keyword)"></p>
<div align="center"></div>
</body>
</html>
Thank to all that help me.