@polesye This might now work reliably. Please see http://stackoverflow.com/questions/4945932/window-onbeforeunload-ajax-request-problem-with-chrome and http://stackoverflow.com/questions/3584288/can-the-unload-event-be-used-to-reliably-fire-ajax-request .