title: Losing session values
body: <p>I have a process that involves a few .aspx pages. Fill out some info in one, hang on to it, move to another page that has an iframe on it, upload some documents in the iframe via a web service to a server, hang on to the list of documents and the status of the upload and then, on a third page, do something else that involves saving all the data to a database.</p>
  
  <p>Before moving from page 1 to page 2, I put some data in Session variables. On page 2, the data is retrieved and displayed, some more data is put into Session variables during the process of uploading the files from within the page in the iframe on page 2 then, on page 3 the data is retrieved from Session and written to the database.</p>
  
  <p>On a test server this all works perfectly. On a live server, I keep getting (random) 'object not set to a reference' errors - which seem to be reporting that the session variables have disappeared.</p>
  
  <p>My understanding is that, within .aspx pages ...</p>
  
  <pre><code>HttpContext.Current.Session["myvariable"]
  Session["myvariable"]
  </code></pre>
  
  <p>are, effectively, the same thing. I am setting my session variable just using ...</p>
  
  <pre><code>Session["Variable1"] = "fred";
  </code></pre>
  
  <p>Any ideas why (randomly, sometimes the process works fine on the live server) I seem to be losing my Session variables?</p>
  
  <p>This is a web site as opposed to a web application. Developed in VS2010 using Framework 4.0</p>