stupid javascript
arrggh.... ok i HATE web programming btw...
ok i have a problem. i want a cookie to be deleted when a popup window closes, NOT when the browser is shut down. Here's what I'm doing to try and make this happen.
in head:
[PHP]
<script type="text/javascript">
function Delete(){
document.cookie = 'phpfreechat=test; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}
</script>
[/PHP]
in the body:
[PHP]
<body onunload="Delete();return false;">
.
.
.
</body>
[/PHP]
but this doesn't work at all, it doesn't do anything....
any ideas?
ok i have a problem. i want a cookie to be deleted when a popup window closes, NOT when the browser is shut down. Here's what I'm doing to try and make this happen.
in head:
[PHP]
<script type="text/javascript">
function Delete(){
document.cookie = 'phpfreechat=test; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}
</script>
[/PHP]
in the body:
[PHP]
<body onunload="Delete();return false;">
.
.
.
</body>
[/PHP]
but this doesn't work at all, it doesn't do anything....
any ideas?
0
Comments
http://techpatterns.com/downloads/javascript_cookies.php
[PHP]// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}[/PHP]