Link to home
Start Free TrialLog in
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.
Avatar of Seven price
Seven price
Flag of United States of America image

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

http://aspalliance.com/520
ASKER CERTIFIED SOLUTION
Avatar of technofile
technofile
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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?
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
Avatar of michouis
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
Keep us informed.

CPG
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.

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.

tHANKS