Session variables disappear

S

Simon

Hi all,

We have a small problem.

We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
farm, on a single server, using in-proc session state, only using one worker
process.

The problem is that at seemingly random times, some of the session variables
return as if set to nothing.

We are using session variables to pass small objects from one page request
to the next. Which seems to work perfectly most of the time, but as I said
above, at random times, some but not all of the session variables return as
nothing.

Anyone any ideas?

Thanks in advance and Regards,
Simon.
 
G

Guest

This is hard to diagnose without a lot of context information, but here is a
suggestion:

Try switching to cookieless for a while and see if the problem persists. If
not, then it may be some sort of cookie issue. The only other thing to be
aware of is that IIS process recycling will force you to lose session state.
The IIS settings on that may be too aggressive.
Peter
 
B

Bruce Barker

check the event log for asp.net recycles - these will clear inproc sessions.
(real production servers should not use inproc sessions for this reason)

-- bruce (sqlwork.com)
 
G

George Ter-Saakov

You can use performance monitor to see how often .NET application restarts.
When it does so all sessions are lost.

Couple reasons why application would restart.

1. new version of DLL was uploaded into BIN folder.
2. More than 15 aspx files were updated/added (15 is configurable value but
by default it's 15).
3. Folder in the project directory was created/removed.
4. There is antivirus active on the machine. Although it will not modify
aspx files it will trigger same sequence as it would. (See #2)
5. The application hanged or reached it's memory limit.

Also check eventlog there might be something in there especially if you have
case #5.




George.
 
S

Simon

Thanks for the reply,

What would you suggest we use instead of inproc.
We have looked at sqlserver, but all objects that you put in session must be
serializable, which some of them aren't

Thanks,
Simon.
 
S

Simon

Thanks for the reply George,

Surely if the application restarts, then all current sessions will end and
all session variables will disappear which we test for at the start of each
page load.

The problems occur after it has already returned several session items, and
then one of them comes back as nothing.

Perhaps the application is restarting mid request? is that possible? or is
it possible that objects can get GC'd when in session?

Regards,
Simon.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top