Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IIS 6.0 Session expired with the following simple ASP lines?!?

0 views
Skip to first unread message

Julia

unread,
Jul 28, 2004, 7:55:27 AM7/28/04
to
Hi,
We are hosting our site in a shared server at our ISP web farm,
The session object is being expired after one minutes or so,
even though the administrator told us that it was set to expired after 20
minutes
in order to check our self we replace our site with two simple pages
the following is the code

Test.ASP

<%@ Language=VBScript %>
<%Option explicit
Response.Buffer=TRUE%>

<html>
<head>
</head>
<%
if Request.Form("Submit")="Submit" then
Response.Write "Session=" & Session("ID") & "<BR><BR>"
end if
%>
<BODY>
<br><br><br>
<form name="Test" action="Test.asp" method="post" LANGUAGE="javascript" >
<input type="Submit" name="Submit" value="Submit" >
</form>
<P>&nbsp;</P>

</BODY>
</HTML>

and Index.asp:


<%@ Language=VBScript %>
<%Option explicit
Response.Buffer=TRUE%>

<html>
<head>
</head>
<%
Session("ID") = "12345"
Response.Redirect "Test.asp"
Response.End
%>
<BODY>

<P>&nbsp;</P>

</BODY>
</HTML>

Guess what,it is still not working,the administrator of the site
insist that there is a problem with our code!!?!?


Thanks


Dror Gluska

unread,
Aug 11, 2004, 3:49:55 AM8/11/04
to
usually he'll be right, the session expires before the defined timeout if
the application pool is recycling.

I use this code to determine if the application is recycling: (from
somewhere on the internet..)
use this inside global.asa
-------------------

Sub Application_onStart

'Log Application Restart
Dim fs,tso
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set TSO = FS.OpenTextFile("c:\inetpub\AppStartLog.txt", 8, true)

tso.writeline now() & " recycled"
tso.close
set tso = nothing
set fs = nothing

End Sub

-------------------

application restart reasons can be anywhere from bad IIS settings, special
recycling settings inside the IIS, ASP command for recycling (don't remember
which is it.. ), too many objects in a certain page, two sites on the same
application pool (and one of them sucks.. :-) ), too many connections to
database, bad code which causes the application pool to crash, access denied
in some cases, if you're using impersonation on the IIS and not reverting
back etc', basically too much something, try to isolate the problem by
taking off all the pages and using what you wrote, if its still doesn't
work, most likely two sites are on the same application pool or the IIS6
recycling settings is too agressive, so, do your tests at your
computer/site/server and send that Administrator specific settings you want,
if he refuses to make those changes, change the ISP.. :-)

oh, btw, session and cookies are not the perfect way to work, write your own
procedures for using database for session management, this will work even
with (almost) the worst network admin... :-)

enjoy,
Dror.

"Julia" <codew...@012.net.il> wrote in message
news:O8R%23HnJdE...@TK2MSFTNGP12.phx.gbl...

0 new messages