title: Periodically execution of backend script
body: <p>My requirement is to execute a back-end script as long as the user has the browser page open and kill the back-end script for user's session in case of any issues at browser side - like user clicks close browser page / browser crash etc and others that we can think off or might be possible.</p>
  
  <p>My requirement is to start a back-end script on user demand and updating the user page with details. At the same time we need to stop the script when user's exists due to any cause. I do understand that having buttons on page to start / stop would help - but what if user closes the page - my back-end script would keep running infinitely.</p>
  
  <p>Please advice which way I can implement  the same.</p>