Link to home
Start Free TrialLog in
Avatar of gogo_clau
gogo_clau

asked on

Asp.Net Session Lost

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.

Avatar of NeoDiffusion
NeoDiffusion
Flag of France image

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.
hi,
    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
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.
Avatar of gogo_clau
gogo_clau

ASKER

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.      
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?
ASKER CERTIFIED SOLUTION
Avatar of Badotz
Badotz
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
No worries - glad to help.