Solved

losing session and application variables on IIS 6.0

Posted on 2004-09-14
14
6,562 Views
Last Modified: 2009-01-15
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?



0
Comment
Question by:sybe
  • 3
  • 3
  • 3
  • +4
14 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 100 total points
ID: 12052526
>>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.

Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 12052553
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.

Cheers!!
0
 
LVL 28

Author Comment

by:sybe
ID: 12052621
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?
0
 
LVL 31

Assisted Solution

by:alorentz
alorentz earned 100 total points
ID: 12053099
>>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.
0
 

Assisted Solution

by:BigTone
BigTone earned 100 total points
ID: 12053104
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...)
0
 
LVL 6

Assisted Solution

by:masirof
masirof earned 100 total points
ID: 12053613
Can you ask them to restart server?
0
 
LVL 11

Assisted Solution

by:Slimshaneey
Slimshaneey earned 100 total points
ID: 12054052
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...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 28

Author Comment

by:sybe
ID: 12054099
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.
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12054158
There are a number of things in IIS6 that will cause IIS to restart....quite stupid actually for just this reason!

http://www.microsoft.com/resources/documentation/IIS/6/all/techref/en-us/iisRG_ADM_20.mspx
0
 
LVL 31

Expert Comment

by:alorentz
ID: 12054169
www.1and1.com seems to be pretty good so far....
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 12054266
Sybe, you prolly already seen this. Most av scanners allow you to skip directories dont they?

http://support.microsoft.com/default.aspx?scid=kb;en-us;316148
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 12061508
0
 
LVL 28

Author Comment

by:sybe
ID: 12066917
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.
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 13097824
Perhaps it's anti-virus software...
http://support.microsoft.com/default.aspx?kbid=303881

They should be able to check their logs to see if the application is restarting.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now