session values lost in release mode

P

Priya

Hi,

When i execute application in debug mode it works but on release mode the
session values in the website is lost. I use windows server 2003 and IIS 6.
It is a 5 step enrollment process whose values are carried forward across
pages. It throws error "object reference not set to instance of object and
points to session values" when moving across pages in release mode.
Pls advise.
Thanks
Priya
 
A

Anthony Jones

my cats said:
Session variables are

- memory that .net releases when it needs to = none of it is guaranteed

Sounds like you are refering to the Cache not the Session. Session
variables will remain until the session expires.
- useful to store temporary information
- with the intent of


try // the following is pseudo code

clsScrubMyData myScrubber = new clsScrubMyData();

if ( Session["myVar"] == null )
{
++NbrErors;
}
else
{
// the following is not perfect, thus the need for ++NbrErrors and
catch
int abc = myScrubber(Session["myVar']);
and so on
}

catch{ Exception lyBigFish )
{
++NbrErrors;
}
finally
{
if ( NbrErrors != 0 )
{
// you have to reinitialize the Session variable
Session["myVar"] = abcdefgh
and so on
}
}

If code in a page depends on previous pages having set up session variables
a simple test of Session.IsNewSession should be made. If true it would mean
that the previous session is likely to have expired.
 
A

Anthony Jones

Priya said:
Hi,

When i execute application in debug mode it works but on release mode the
session values in the website is lost. I use windows server 2003 and IIS
6.
It is a 5 step enrollment process whose values are carried forward across
pages. It throws error "object reference not set to instance of object and
points to session values" when moving across pages in release mode.


What exactly do mean by debug mode and release mode?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top