473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

session values lost in release mode

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
Sep 17 '08 #1
3 1330
Session variables are

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

- 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
}
}
Sep 17 '08 #2
"my cats, Gag and yak" <mr********@comcast.netwrote in message
news:qv******************************@comcast.com. ..
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

Sep 18 '08 #3
"Priya" <Pr***@discussions.microsoft.comwrote in message
news:50**********************************@microsof t.com...
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

Sep 18 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set...
10
by: Jacob Anderson | last post by:
Hello, I have a web application running in two configurations: 1. On my local machine running in debug and release mode 2. On a shared, hosted, machine in release mode On my local machine,...
3
by: Carpe Diem | last post by:
Hello I have an aspx page that loses Session("user") value after a few minutes even after I set <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config and wrote function...
9
by: Patrick | last post by:
Hello I'm running two Webservers Using ASP.NET. both are running the same ASP.NET Application, with <sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424"...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
9
by: Adrian Parker | last post by:
We have a website that works everywhere but on a few PCs on this one site.. Asp.Net 1.1 Server = Windows 2003 Client = XP In the web.config we use - cookieless="false" in the browser settings...
9
by: gnewsgroup | last post by:
I am using forms authentication for my web application. In web.config, I have this: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="120"...
3
by: dihola | last post by:
Hi, I have a website running in IIS7 and it seems to be creating a new session for every request I make. The values I store in Session are lost with every request. This is the forms bit in my...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.