Web App Service Session won't stop!


We have a standalone web service app that we use to generate and download Word reports from another web app. When the app receives an URL, it starts generating a new report using the sent URL parameters.

We do want to quit the session ant the the active tab (the report download tab) by triggering the Session.Quit command from a Message Box that is on the page.
When we do so, instead of closing the sessio, it restarts a new download in the same tab. In fact I noticed that the session closes but only after the Report download has started again. The only way to stop that is to close the tab directly in the browser.

I feel like something is wrong about its structure so here some infos about it :

Session.Open : Checks URL parameters
DefaultWebPage.Shown : executes successively all the following

  • Method ExecuteExport() : Connects to DB, Checks user credentials, Calls the SelectExport method and downloads the file returned by the SelectExport method.
  • Method SelectExport () As FolderItem : Selects the the download method according to the URL parameters received and returns a FolderItem as a WebFile

At the end of the report creation process, the open file windows appears as the file download is finished.