title: browser back button and session state in asp.net
body: <p>I am trying to handle a problem i have when the user clicks the browser back button.</p>
  
  <ol>
  <li>If i do not disable caching the page is loaded from the cache. The problem is i have data saved in the session object and this data is not synchronized with the page display so i get errors when the user makes a further request on that page.</li>
  <li>If i disable cache I get a "<code>Confirm Form Resubmission</code>" on chrome. This happens because interacting with asp.net pages uses post requests (in order to send the view state) so the browser is asking if it should resubmit the form.</li>
  </ol>
  
  <p>Both possibilities are problematical for me.
  What is the best way to handle this problem?</p>
  
  <blockquote>
    <p>Edit:</p>
  </blockquote>
  
  <p>I wrote the answer i found below.
  It seems to me to be a hack. If anyone has a better solution i'd be happy to see it.</p>