If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Delete cookies after onbeforeunload

I am trying to delete cookies after a person leaves the page or refreshes. I am pretty new at this. Anyone got a working script?

<script language="JavaScript">
window.onbeforeunload = confirmExit;
function confirmExit()
{
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
}
</script>

onbeforeunload isn't cross-browser compatible, and I _think_ it's going to be deprecated.

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

Since all those dialogs are for debugging only there shouldn't be any need to have them in the onbeforeunload processing anyway. For testing why your code doesn't work you could always use an older browser that still allows them there if the console doesn't report anything and you can't be bothered to learn how to use the built in debugger.