Lost sessions issue

A

AlonR

Hi,

We're experiencing random user sessions losses on our web applications,
and are researching for any useful information which may shed light on
this problem.


Environment:
In our company, we're developing a web product based on ASP.NET 2.0, in
conjunction with Oracle database over ADO.NET and external COM objects
running on the server, interacting with the database, and with external
modules.
Our servers are Windows Server 2003, running IIS 6.0, with all the
latest patches and updates provided by Microsoft. Web application on
the server is a precompiled version of our web solution.


Users:
Number of users on the system is currently minor, less than 10
concurrent users.


Sessions:
We use ASP.NET infrastructure for saving data into session variables.
Our sessionState mode is InProc, and our application sometimes loads
our sessions with heavy information variables (e.g. grids, DataSets
etc).


The problem:
This problem is completely inconsistent, and has no specific scenario
steps. Randomly, our sessions disappear.
HttpContext.Current.Session.IsNewSession becomes true, and all session
variables are lost. The Session Id is sometimes reset and replaced, and
sometimes left unchanged.
We know for sure that this is not a session time-out issue, as sessions
are lost while they're active. Sometimes users lose their sessions
right after logging in, and sometimes after a while of using the
system, sometimes they're not lost at all.

Our system has a handler for such failure (namely, directing the user
to the main login page, in order to start a new session), but we need
to research and find the root cause of this problem.
The failure occurs on random pages, and in random scenarios. Repeating
a scenario after a failure usually yields successful results (i.e. the
failure does not repeat itself).

Research:
This gives us the impression that the problem is probably IIS internal,
and/or depends on very specific status, or a fault in one of our
modules. We do not know of any specific memory leaks in our product.
We are not sure that this is an unhandled exception issue, which can be
resolved by HttpContext.Current.ClearError. Any information about this
topic would be appreciated as well.
Also, it's quite unlikely that those session losses are caused by
configuration files changes, or by changes to the
environment/recompilation of ASPX files.

Are there ways to monitor IIS in order to get a better idea about its
session handling?
Is there a way to follow a session and know what caused its closure?
Any hint would be highly appreciated.

Thank you,
Alon.
 
J

Joerg Jooss

Thus wrote alonr,
Hi,

We're experiencing random user sessions losses on our web
applications, and are researching for any useful information which may
shed light on this problem. [...]
We are not sure that this is an unhandled exception issue, which can
be
resolved by HttpContext.Current.ClearError. Any information about this
topic would be appreciated as well.
Also, it's quite unlikely that those session losses are caused by
configuration files changes, or by changes to the
environment/recompilation of ASPX files.
Are there ways to monitor IIS in order to get a better idea about its
session handling?
Is there a way to follow a session and know what caused its closure?
Any hint would be highly appreciated.

It could be an unhandled exception in a background thread. See http://support.microsoft.com/?id=911816
helps.

And just to be sure that the worker process doesn't get bounced, monitor
the total items in Cache using Perfmon. Maybe you have a certain use case
where you're caching a super sized object graph in session state (which ends
up being a Cache entry at the end of the day).

Cheers,
 
A

Andrew Morton

AlonR said:
We're experiencing random user sessions losses on our web
applications, and are researching for any useful information which
may shed light on this problem.

Try using sessionState mode="StateServer" in conjunction with the ASP.NET
State Service service.

Do you have the Web Garden setting (in application pools) at more than one?
That would cause it, because successive requests may go to different
instances which can know nothing about each other unless the state is stored
out-of-process.

Andrew
 
W

William LaMartin

Two possible solutions:

Ask your web host to increase the Virtual memory limit on their application
pools. I had a similar problem and that solved it.

Recompilations are triggered by changes to the contents of the
application's \bin folder and hence a lost of session. Do you have a file
in the bin folder than is changing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top