Link to home
Start Free TrialLog in
Avatar of anguslai
anguslai

asked on

lossing Session/Application variable

I use Application and session variable in my web application, with W2K, IIS5, SP2.

Application, and session variable would disappear after the IIS running a few (3) days. (The value the variable is empty)

Application varible and session variable may disappear in different time.
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden image

If an application is unused for some time (overnight?), the IIS may decide to stop the application to preserve resources. I don't know the exact criteria for this to happen, but I imagine that it depends on the worload on the server.

For this reason, you should always set the application variables in the Application_OnStart sub in global.asa. This way, when the application starts again, the application variables are set up with the correct values.

Session variables disappear when the session ends. This usually happens when the session times out; the default Session.Timeout value is 20 minutes, meaning sessions will end 20 minutes after the last contact with the user. When the application ends, all it's session ends also, of course.
Avatar of anguslai
anguslai

ASKER

More Infomation about my probLEM:

Application Variable: I did put the variable in Application_OnStart sub in global.asa, However, it still disappear from time to time.

Session Variable: I set a session timeout to 600 minutes. Wire thing is: Your session variable may loss even you are using the application continously. (Keep send back and forth to server)

I know some other company also have same problem, Any one knows more information?
ASKER CERTIFIED SOLUTION
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden 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
Greetings,

One of the ways to have the server clog up memory and start panicing, as GreenGhost puts it, is using MS Access as a web database.

Normal applications aren't used all the time, so Access gets a change to shut down and release resources. There are some applications which need to run 24/7. Access doesn't like that. Solution: don't use Access when the site needs to be used continuously.

Imagine!
GreenGhost, Your comment for session is possible and let me return to you after some test.

OmegaJunior, also thanks to your answer. We did considered database solution; however, the preformance issue is the reason stop us to use it.
This question appears to have been abandoned. Please come back to this question and do the necessary evaluation or feedback. I will invite a Moderator to close this question if there's no reply from you after seven days.

I suggest
<points to GreenGhost>

** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **

hongjun
Force accepted as proposed

modulo

Community Support Moderator
Experts Exchange
Just ran into exactly the same problem. IIS is running on my local box:
Win XP Service Pack1, 2.2GHz, 1GB RAM, IIS 5

Once in a while all Application variables disappear (just become blank).
Looks like it happens on computer start-up also. Random playing with
killing DLLHOST, restarting IIS, and Deleting/Recreating web app eventually
fixes it (didn't quite figure the right order yet).

All application variables are defined in Application_OnStart in global.asa
and are never changed. It almost looks like OnStart event never fires!
I am running regular ASP 3.0 pages.

This box is my development machine. It is NOT running out of resources.
The only thing that is different on it from other "normal" development boxes
is that it has Visual Studio 6.0 AND Visual Studio .NET installed together,
with local debugging enabled... yeah, that would be pushing it :)  

Any suggestions?
Greetings,

VS6 together with VS.Net shouldn't be a problem. With a big "shouldn't". I've had them both on my W2K machine and suddenly IIS5 didn't run at all. Reinstalling IIS5 didn't work. I had to remove VS.Net, remove the .Net framework, reinstall VS6 and IIS5 before IIS started behaving normally again.

May Win XP be the problem? Was XP meant to function as a web server? I thought the IIS only ran stabily on NT / W2K?

If your application variables vamoush, does that leave a trace in the event logs?

Imagine!
No, don't think XP is a problem. At least it wasn't in my 2 last development shops where every developer had WinXP with IIS5 and VS6. Sure it crashes dev environment 3-4 times a day, but what developer doesn't need a break?  :)  Enabling debugging on XP, with both VS6 and VS.NET installed WAS though, sort of a challenge. You can only have debugging in one or another, that's as much as I figured.

Back to the subject, as I stand today, IIS in the morning desided to behave and shows Application variables as expected. So it gets hosed at startup at random. No event log errors that I could relate the problem to...except maybe these:


Error: "Automatic certificate enrollment for local system failed to contact the active directory (0x8007054b).  The specified domain either does not exist or could not be contacted."  (I don't think this autoenrollment ever worked).

Information: "The description for Event ID ( 0 ) in Source ( Machine Debug Manager ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer..."

What will tomorrow bring?
Greetings,

Although this autoenrollment acts on the active directory, this may be a symptom of a remote access problem. Especially when the machine should have been able to enroll into the active directory.

Then, what you'd look for, are problems with the remote access and telephony services.

Doesn't Microsoft have a KB article on your problem? Probably not, otherwise you wouldn't have asked it here. That would mean, they either never tried, or they thought no-one would.

I'd suggest the easy way out. Take a second machine and split up VS6 and VS.Net. If your problem is gone, it's been the combination. If not, there's something else and we've eliminated one possibility.

If all possibilities are eliminated, what remains must undoubtedly be true. Elementary, my dear Watson.
Actually, if all possibilities are eliminated, you undoubtedly missed one. Your Holmes had problems with logic :)