Avatar of michouis
michouis
 asked on

Session variables keep expiring or dying

Just launched an ASP .Net Web Site and am using session variables allot throughout to store customer name, shopping cart table, product tables, order date, PO# etc... the list goes on. I have set <sessionState timeout="520"></sessionState> in my Web.config file. I also set the IIS 6 application pool settings; recycle worker process at 5:00 am every day only, no IDLE TIMEOUT, Rapid Fail Protection is on for 20 errors in 1 minute which we are not getting so many errors in 1 minute according to the application event viewer on this Windows 2003 server. ASP.Net 2.0. 3 gigs of RAM, no memory usage issues. Normal user load = 20 users at a time.

Yet our users are often getting nullreference exceptions, object reference not set to an instance of an object. Every time I review the page and line of code this happens at it can only be due to the session expiring for some unknown reason. This is extremely urgent as our customers are losing faith in our web site and are not going to order from it any more.

Please help.
P.S. Our IIS 6 server is running as a virtaul machine in case this matters.
.NET ProgrammingASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
michouis

8/22/2022 - Mon
Seven price

Make the session at least 1600 or more if not here is a good Article.

http://aspalliance.com/520
ASKER CERTIFIED SOLUTION
technofile

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
copyPasteGhost

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Nasir Razzaq

Are you sure you are not using Session.Abondon() anywhere?
Do you make any chages to the web.config file while the web is live(this resets the session)?
Have you checked the session timeout on the Application Configuration in IIS?
copyPasteGhost

Any changes to the App_Code folder will also reset the session.

For that matter any change that causes an application pool reset will rest the session.

You for sure would want to check on that.

CPG
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
michouis

ASKER
Thank you all. I am still monitoring the isue after adding some additional checks in the code. If I see ore recurrences then I will try above suggestions and let you know.
Thanks
copyPasteGhost

Keep us informed.

CPG
michouis

ASKER
So far so good... I think this is resolved. It can get tricky.... but I think I got a handle on it.
Will keep you posted, still getting the odd object reference not set to an instance of an object revolving around a session variable but quite rare. I think session state is actually working fine.

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
michouis

ASKER
I think that whatever remaining errors like this I am getting are due to people trying to navigate directly to a Web Site page that you must be logged in to view without an error... I need to add some logic at the beginning of each "private" page checking if the user is lnot logged in then redirct to Home.aspx where yee belong.

Thanks all.

michouis

ASKER
tHANKS