I have a page where the user can start a background process. I’d like to stop this process in case the user refreshes the page or closes the tab or browser. Tried connection_abort() but no luck, the script just goes on running.
Any ideas?
I have a page where the user can start a background process. I’d like
Share
I think you are out of luck.
httpis a stateless protocol, as soon as your page is served the connection is closed.Besides some ajax tricks, there is no way to tell that the user refreshes or closes the browser.