I'm trying to record user sign out time in mysql DB once he close the browser. I searched for it but the most articles talking about window.onbeforeunload
JavaScript event, but doesn't work with all browsers. even it works with F5 button can't specify massage or action,.
<!DOCTYPE html>
<html>
<body onbeforeunload="return myFunction()">
<p>Close this window, press F5 or click on the link below to invoke the onbeforeunload event.</p>
<a href="Google.come">test by redirecting</a>
<script>
function myFunction() {
return "specific massage";
}
</script>
</body>
</html>