Quoting a comment from **stackoverflow**:

    Like @Garry English said, sending an async request
    during page onunload will not work, as the browser will kill
    the thread before sending the request. sending a sync
    request should work though.