Author: sunsilk10 | Posted on: 5/6/2009 5:01:36 AM | Views : 436

I am using asp.net 2.0 Visual Studio 2008 and .net framework 2.0 and IE 6

I seem to lose the session variables in my application. I am using Forms Authentication

Application starts with Start.aspx  then use redirectFromLoginPage to redirect to index.aspx, which contains a disclaimer statement.

From index.aspx I then redirect to Default.aspx using Response.Redirect("~/default.aspx", false)

In Default.aspx.cs in OnPreInit, I check for (!Page.IsPostBack) and assign a session variable "VAR1".

I want to use this variable later on for one functionality in the application. When I deploy in IIS, this functionality works fine the first time, but fails in subsequent times. It comes up with Object Reference Not set (as Session variable "VAR1" does not exist"). Also sometimes, when I refresh the Default.aspx page in the browser, it comes up with same error message.

Any suggestions??

&n ...

Go to the complete details ...