Question 1: When you say it is a Session Loss, what actually
happens? Does the person browsing the website get logged out all of a sudden
and he gets re-directed to the Login page (OR is it something specific he does
which logs him out)?
Answer 1: Varies, since it is an open ended question.
Inference> At this point, it could be a session timeout
issue or a session loss or anything else for that matter! The only thing which
is certain is that we need to ask a lot of other questions and narrow the issue
down to something which we could fix.
In comes Question 2: Is the issue random? Can you reproduce
it at will?
Answer 2: Let us say the answer is YES, it is Random (this
is the case mostly). I would jump to Question 3. If it is reproducible, I
become quite happy and jump to Question 4. Basically, if the issue is
reproducible, you will have quite a few ways in which you can fix it which is
good. The unfortunate part is that you might have to go with trial and error,
which could be painful.
Inference> Without even doing anything, we now have a few
areas to look at depending on whether the issue is reproducible or not. Have a
look at the next questions.
Question 3: At this point we know that the issue happens
randomly. So, I am now keen to find out if all the users get logged out at the
same time, it is problem with just some client(s) OR all the users faces this
Answer 3: To me it is one of the most important questions. I
will tell you why.
Let us say he says “Yes,” all the users get logged out
sporadically at the same time.
Inference> That would mean that there are two possibilities now at a broader
level. The Application Domain is getting recycled for some reason OR the worker
process (aspnet_wp.exe > in XP or 2000 box OR w3wp.exe > in 2003 box) is
The question now is… how you will find it out if it is…
You can add a Perfmon counter and monitor your server as
Click Windows Start button -> Run. Type Perfmon and click
Expand Performance Logs and Alerts.
Right click Counter Logs and select New Log settings.
Type a name and click Ok.
Click on Add Counters button.
From the Performance object select ASP.NET v.1.1.4322 or the
ASP.NET version of your application.
Choose Select counters from list and select Application
Click Add, Close, and Ok.
You will notice that the Perfmon will start logging data
into this log file.
Once the issue happens (I mean all the users get logged
out), right click on your Counter Log file and click Stop.
If you right click and choose properties, it will show you
the path where the log file is stored. By default, it is C:\Perflogs, but you
can change it.
Notice the path, go to System Monitor in the left pane and
click View Log Data in the right pane.
Add the Log file using Add button and click Ok.
Click on Add Counter (+) button, select Application Restarts
counter and click on the Add button. Click Close.
Basically, we are checking if the ASP.NET applications are
starting for any reason. If it is doing so, you will see a value > 0 and
your graph might look like a single (or multiple) step (s) in a staircase.
I have reproduced the Application Restart by touching web.config of my
Application a few times. Notice the graph has steps. Also, notice that I have
changed the Graph of Perfmon to 10 and the scale for the Counter is set to 1,000
so that the graphical representation makes more sense
If you see this, it means that your ASP.NET application is restarting because
of a web.config change, a machine.config change, global.asax change, your application’s
bin folder change or multiple changes in your aspx files. If that is the case,
check the following scenarios.