title: Prevent expiration of individual sessions based on custom conditions?
body: <p>A website I am working on is very data centric. Some reports take more than an hour to complete. Whenever a user submits a request for a report, a new thread is created which generates the report. The user is then redirected to a page which says that the report in progress, and to please refresh to download the report. If the user again refreshes the page and the report is still in progress, the same message is shown; otherwise a download link is provided.</p>
  
  <p>All report/user relations are saved in the application variable. That works fine, except when the user is inactive for more than 20 min (while the report is being processed), and then the user is logged out; if the user logs in again, the report can still be downloaded.</p>
  
  <p><strong>I do not want to increase the session expiration time, but I need to stop the expiration if the user has something going in background, like a report being processed.</strong></p>
  
  <p>In Session_End I am able to retrieve the the <code>userid</code> and match it in <code>Application["work"]</code> to see the user has pending work or not.</p>
  
  <p>However, I am clueless as to how I can defer the session end in the above case?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> Every one has suggested as a workaround from 'maintaining a contact' to 'using query string'. 'Maintaining the contact' looked the most promising to me but it fails in the following scenarios: a. When browser is closed/computed goes in standby mode during lunch, etc. b. When user goes to another non-asp.net section (it's a legacy site).</p>
  
  <p><strong>Isn't It possible to cancel the <code>Session_End</code> event itself?</strong></p>