losing session and application variables on IIS 6.0

A number of websites with database/session based login have recently been moved from IIS5.0 to IIS6.0
Everything works, except that the Session and Application variables are lost every 3-4 minutes. The fact that also the Application variables are lost, means that somehow the application is being restarted ever so often.

Has anyone experiences like this?
Can anyone point me to why this happens and how it can be solved?

LVL 28
Who is Participating?
ap_sajithConnect With a Mentor Commented:
>>Has anyone experiences like this?<<

No, I havent come across such an issue yet. However, it would be helpful if you posted the code that sets the application variable.

Also, did you check the Event logs for anything that could be causing the restarts.

Another thing that just came to my mind... Maybe the Virus scanner is messing around with the asp pages. Try running your code after disabling the virus scanners. Or, make sure that .asa and .asp files are excluded from realtime filesystem protection feature.

sybeAuthor Commented:
the problem is that it's on a remote server i can not control.

There wasn't any global.asa before, but i noticed that session variables kept disappearing after 3 minutes (not very user friendly if you want to update your data). I put in a global.asa just to check what was happening: does the website only lose Sessionvariables, or also Applicationvariables. It is losing both every three minutes.

All sites on this server were recently moved to a new server. They were working without problems on the old server.

global.asa is this:

Sub Application_OnStart()
    Application("starttime") = Now()
    Application("starttimer") = Timer
    Application("test") = 1
End Sub

Sub Session_OnStart()
    Session("starttime") = Now()
    Session("starttimer") = Timer
    Session("test") = 1
End Sub

The virus-scanner isn't a very bad idea, i'll check that. As far as my knowledge goes only editing the global.asa will restart the application, am I right?
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

alorentzConnect With a Mentor Commented:
>>the problem is that it's on a remote server i can not control.

That's probably it, they are doing something.  Who is controlling the server...?

I know you are quite familiar with coding, so this is most likely not a coding issue.
BigToneConnect With a Mentor Commented:
Restarting IIS, stopping/starting a website within IIS or causing the global.asa file to change will cause the Application/Session objects to be repopulated.

As well as that, if you call Session.Abandon, that will end the Session prematurely. If all Sessions end within an application, the application's ON_END block calls, and wipes the App out too.

It's also possible that another site on your host's server - in your application pool on Windows Server 2003 or on your server in Windows Server 2000 - could be causing IIS to restart itself. If that's what's happening, there's very little you can do short of creating new ways of storing your session/application state elsewhere (such as a local MSDE database, text files etc...)
masirofConnect With a Mentor Commented:
Can you ask them to restart server?
SlimshaneeyConnect With a Mentor Commented:
I believe there is a feature of IIS6 that restarts the Application or IIS every time a major fault happens, or every 5,000 page hits. It should persist the data, but maybe that is not happening. I could be talking utter rubbish, wouldnt be the first time, but I do remember reading something along those lines...
sybeAuthor Commented:
I have been suggesting the virus-scanner top the admins of the site(s). Waiting for them to answer now. They are somewhere at the other side of the globe, so i don't know how long it will take for them to answer.

Anyway, thanks for the suggestions so far. And if you have any more ideas: let it come. It's quite nasty that our customers have to login every 3 minutes.
There are a number of things in IIS6 that will cause IIS to restart....quite stupid actually for just this reason!

www.1and1.com seems to be pretty good so far....
Sybe, you prolly already seen this. Most av scanners allow you to skip directories dont they?

sybeAuthor Commented:
The admins said:

"A worker process with process id of 'xxxx' serving application pool 'domain.com' has requested a recycle because it reached its virtual memory limit. "

In don't know, but the problem seems solved now.
Thanks everyone for their input and ideas. I'll give everyone points who went through the trouble of answering.
Perhaps it's anti-virus software...

They should be able to check their logs to see if the application is restarting.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.