I've had some success with doing thing in an <iframe> which is invisible and has a negative z-index. this would avoid having to pop-open a new window, that might be disabled by newer browsers anyway. For example:
create an cross-browser invisible style:
.invisible {
display: none;
visibility: hidden;
z-index: -100;
position: absolute;
top: 0px;
left: 0px;
}
then the frame:
<iframe id="ifrm" class="invisible"></iframe>
then on unload do this in a js fcn:
if (document.getElementById) var ifrm = document.getElementById("ifrm");
else var ifrm = document.all.ifrm;
_frm.src = "unload.php";
I don't know what kind of stuff you're storing in that file, but it seems like you might just want to see if you could store it in a cooke, and then it would be easy to expire the cookie on unload.
finapollo