| Kennan 2006-04-18, 6:57 pm |
| Session variables being lost
4/18/2006
Symptoms:
1) Users see TimeOut.asp page.
2) BlankOrder.asp page is displayed to user and e-mail is sent to me.
Code: APS (not .net)
Global.asa:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
Session.Timeout = 30
Session("School") = "default"
Session("Semester") = "default"
Session("School_Name") = "default"
Session("Background") = "default"
Session("Secure") = "default"
End Sub
Sub Session_OnEnd
Session("School") = "default"
Session("Semester") = "default"
Session("School_Name") = "default"
Session("Background") = "default"
Session("Secure") = "default"
End Sub
</SCRIPT>
CBHeader.asp
At the beginning of each page is server side include (CBHeader.asp) that
checks the value of three of the session variables. If the value is
“default” then processing is rerouted to Timeout.asp.
if ((Session("School") = "default") OR (Session("Semester") = "default")
OR (Session("School_Name") = "default")) then
Response.Redirect "timeout.asp"
end if
Situations:
1) TimeOut.asp page is displayed every time a particular user goes from
Page 1 to Order1TN.asp. In one case this happended (denise), she just got
out of IE and back in and it worked. Another case 4/17/06 Jana at Santa Anna
college (SAC) she got out, rebooted and it still didn’t work. She made sure
cookies was on within the browser but could not get it to work. I checked
the IIS Log and found that between Page1.asp and Order1TN.asp “Default.asp”
would show up everytime. (Default.asp has a Session.Abandon statement that
will reset the session causing this behaviour). The Default.asp page did not
display rather the Order1TN.asp code re-routed the page to TimeOut.asp.
2) TimeOut.Asp page is displayed randomly throughout the application. It
is not similar to the above situation in that they can try it again and it
will work. Sometimes they have to get out of IE but not always. Also the
IIS log does not show Default.asp except where they have selected it.
Occasionally “favicon.ico” will show up around the TimeOut.asp which may
indicate that they were trying to use a bookmarked page. This will not work
since the session variables would be gone in this situation, however this
file is only occasionally seen. In other words, the Timeout.asp page would
occur occasionally so they are not a concern, it’s the many times (over 100
per day) that the customer was proceeding through the application normally
and they were re-routed to TimeOut.asp that is the concern.
3) On the final page, occasionally some of the session variables are
blanked out (not reset to “Default” by the global.asa file). In this case
the primary session variables that I check for re-routing to Timeout.asp are
not reset to “Default” but have correct values. Only some of the session
variables are “lost” (set to “”). I capture this situation and display the
BlankOrder.asp page and send an e-mail to myself. In some cases we have only
the school ID and Semester, other times we have all of the info except the
student’s name and the items. In one case we had parts of the name (broken
up between the first, middle, last name fields but not correctly).
Tech Info:
This problem began (as far as we know) after January 2005 when we moved
from a Windows 2000 server to Windows 2003/IIS 6.0. There have been
continuous code changes but we have been unable to duplicate the problem and
a user will re-try the same thing and it will work so it seems to be
environment related rather than specific code.
1) Web Server:
Windows 2003
IIS 6.0
Application Pools (I believe these are the default
settings)
Default Application Pool
MSSharePointApp
Settings for all Application Pools:
Recycle Worker Processes
= 1740
Shutdown worker
Processes after 20 minutes
Request Queue limit = 4000
Web Garden = 1
Enable Pinging = 30
Enable Rapid Fail Protection
Failures = 5
Timeout Period = 5
WebSites:
Default Web Site – this is the site
having problems
CapGownAndTassel.com – this site is
not currently used
Microsoft Share Point Administration
2) Symantec Antivirus/SMTP Security
3) Event Log is not showing any recycling of worker processes except every
29 hours. TimeOut.asp is
happening much more frequently than that. IISCrashHangAgent starts, then
stops about 20 minutes later about 5 to 7 time per day, no log is created.
What I’ve read:
1) “If antivirus is modifying the global.asa the application will be
restarted.” I have checked the global.asa file and the date modified has not
been changed.
2) “Turn off the Recycle Worker Processes and Disable Rapid Fail
Protection”. We only have one application so the application pools are not
needed. I would like advice before I try this since it appears that changes
to these settings cause all the sessions to be restarted and I don’t fully
understand all of the impact of these settings.
3) “Use State Server rather than InProc”. It appears to me that this is a
..Net option and is not available to classic ASP – is that correct? If I can
use it – how?
4) “Change the application so it doesn’t use Session Variables”. This is
my next option if nothing can be resolved via IIS.
I apologize for all the details, but I hope it leads to a quick resolution –
as you can see we have been dealing with this for a long time.
Thanks,
Kennan
|