I’m trying to disconnect a user when “unload” event is fired !
$(window).bind('unload', function() {
$.ajax({
url: "deconnexionUser.php",
async: false
});
});
It works but i don’t want to use “async : false” !
What should I do ?
If you use
beforeunloadyou won’t be competing with the window closing: