P
Phil Powell
I thought this would work but it seems to not work neither in Netscape
nor in IE:
However, instead of the expired cookie being set into the frame's
parent's window.opener document, nothing is set, however, redirection
takes place but incorrectly since the cookie's instance still exists
when the window.opener is refreshed.
So how have you guys done this correctly where I have gone wrong?
Thanx
Phil
nor in IE:
Code:
<script type="text/javascript">
<!--
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm
// NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY
AND THUS EXPIRE
function setCookie(name, value, days) {
var today = new Date();
var expire = new Date();
if (days == null || isNaN(days) || days == 0) days = 1;
if (days >= 1 || days < 0) expire.setTime(today.getTime() + 3600000 *
24 * days);
document.cookie = name + '=' + escape(value) + ';expires=' +
expire.toGMTString();
}
setCookie('val_chat', '**DELETE**', -1);
self.parent.window.opener.document.writeln(document.cookie); //
DELETE PARENT WINDOW'S COOKIE
self.parent.window.opener.location.href = 'chat.jsp';
self.parent.close();
//-->
</script>
<noscript><!-- NO EQUIVALENT --></noscript>
However, instead of the expired cookie being set into the frame's
parent's window.opener document, nothing is set, however, redirection
takes place but incorrectly since the cookie's instance still exists
when the window.opener is refreshed.
So how have you guys done this correctly where I have gone wrong?
Thanx
Phil