Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > session values lost in release mode

Reply
Thread Tools

session values lost in release mode

 
 
Priya
Guest
Posts: n/a
 
      09-17-2008
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
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      09-18-2008
"my cats, Gag and yak" <> wrote in message
news:. ..
> 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.

--
Anthony Jones - MVP ASP/ASP.NET

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      09-18-2008
"Priya" <> wrote in message
news:5064B702-253F-4A7F-8566-...
> 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?


--
Anthony Jones - MVP ASP/ASP.NET

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control access fails in debug mode, works in release mode rbg ASP .Net 0 01-17-2007 10:51 PM
Response.Redirect is slooow in debug mode, ok in release mode =?Utf-8?B?TWF4?= ASP .Net 0 02-11-2006 12:37 AM
Re: lost session values, not Session Alvin Bruney [MVP] ASP .Net 0 03-02-2004 06:35 AM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
Debug mode dll's vs release mode dll's? Dave ASP .Net 0 02-20-2004 03:49 AM



Advertisments