See if I can explain this one correctly.
I am using the onunload event on the <BODY> tag to call a javascript function that uses window.open() to run another php page which simluates a logout and does some database work. The intent is that when the user closes thier brower using the x or simply changes the URL to a different domain that this other page will fire and clean up some data in the database like the logout would do if they had logged out correctly.
Problem: This fires when the user presses refresh or back.
Is it possible to use javascript to trap for when the user presses refresh or back so that I don't call my cleanup page and log htem out when all they have done is refreshed the data?