We help IT Professionals succeed at work.

Asp.Net Session Lost

gogo_clau asked
Last Modified: 2008-02-01
I have a application that runs fine on my development servers but as soon I put the application on the production servers I start losing my Session variables without the session expiring. I store the user ID in a session variable and keeps checking this variable until it no longer exist I redirect the user to the Login page. The problem is that the application returns the user to the login page in about 3-5 mins after login in sometimes even faster or slower. What I have notice is that it is not login off all the user at once it’s per user that the variables get lost. I have read the article about the Anti-virus touching my config files and my global asax, the anti-virus software I am using is MacAfee Virus- scan Enterprise. I have configured this to skip the above mentioned files but the problem still persists. I have tried using the State_server Mode but this didn’t solve the problem either.

Watch Question

Similar issue occured to me. The root cause was an issue with the pathname used to store the sessions.

First, have a look at your webservers logs and error logs. Seems obvious, but I've done it only after several hours... wheras the root cause was highlighted there...

Then, check the way sessions are stored on your production server. If files, make sure that the path actually exists, and try to create a dummy file.
    If your server is load balanced you will get this issue. For this thing you have to gofor out of process session

thanks & regards,

Krishna kumar.M
Top Expert 2007

So, what is the difference between your development servers and your production servers? Figure that out and you may discover why you're having the problem.


My Development Machine is a regular XP pro desktop and the web server is win 2003 server, dual dual core processors. I have tried to run the session in the out process but it still flushes my variables. I have check the Web log files but the information is too much for me go through. I need a easier way to read those log files as well some sort of decode file to help me understand the log better.  I heard that there was a hotfix for such a issue but after some research I found it was for a differerent issue. I have also setup my global.asax file to trap any runtime errors and save them to a log to see if I could find whats causing the issue but the only thing recorded was the times at which the application shutdown and startups which are normal if no one is using the application after hours.      
Top Expert 2007

Store the variables in an XML file instead of the Session object? Or a .INI file? At least you will then have a functioning site, and the pressing issue of Session vars won't be as oppressive.


If I used Sql Server will My variable info get set out to the database or just the identifier for the session, just as what happens when you store it out to the URL string?
Top Expert 2007
This one is on us!
(Get your first solution completely free - no credit card required)
Top Expert 2007

No worries - glad to help.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.