Cookies

admin

Administrator
Staff member
Hi, I hope someone can help me out! I want to delete cookies on this page without having to refresh the page. How can I fix my code so that this is possible? Thanks in advance! Here is my code:

<script language="Javascript">
var UserFirstName=extractCookie("firstname");
document.write(UserFirstName);
document.write("<br>");</script>
<br>
First Name:
<script language="Javascript">
var UserLastName=extractCookie("lastname");
document.write(UserLastName);
document.write("<br>");</script>
<br>
First Name:
<script language="Javascript">
var UserEmail=extractCookie("email");
document.write(UserEmail);
document.write("<br>");</script>
<br>
<script language="Javascript">
function EraseCookies(){
var expDate=new Date();
var theMonth=expDate.getMonth();
expDate.setMonth(theMonth-1);
expDate=expDate.toGMTString();
document.cookie="firstname=;expires="+expDate;
document.cookie="lastname=;expires="+expDate;
document.cookie="email=;expires="+expDate;
}
</script>
<form name="GuestForm">
Erase Your Cookies:<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Erase Your Cookies" onClick="EraseCookies();">
</form>
 
Top