Note that there are some explanatory texts on larger screens.

plurals
  1. POSession clears ends when debugging ASP.NET but works fine on the dev and test server
    text
    copied!<p>I'm having a strange issue where the session ends after a postback when I debug it in visual studio 2010. </p> <p>I store a variable in a session on the first page. It keeps its value in the next page but after that it gets lost. It returns a null value. The strange thing is when i copy the exact code to the dev or test servers, it works fine...</p> <p>Any ideas what could be happening? Thanks. </p> <p><strong>UPDATE</strong><br> The code is fairly simple. I have a <strong>default.aspx</strong> page where I'm setting a session variable:</p> <pre><code> HttpContext.Current.Session["PurchaseOID"] = purchaseOID; </code></pre> <p>When I click 'Next' the Default.aspx page redirects it to a Information.aspx page. Additional user information is gathered on this page (using DevExpress controls). When I click 'Next' on this page the session variable "PurhcaseOID" returns null on page load.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if(HttpContext.Current.Session["PurchaseOID"] == null){ throw new Exception("error!"); } } </code></pre> <p>Whats strange is, the Session is kept when the page is first loaded. But on postback, it loses its variables. Also, this is something that JUST started happening. I've been working on this code for a month or so and it's been working fine. When I deploy this exact code to our dev or test server, it works fine. </p> <p>I'm debugging this in Cassini. Help would be greatly appreciated, thanks!</p> <p>Shahzad Chaudhary</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload