I have a problem with my global.asa. I posted earlier this week and had only one response, but it wasn't what I was looking for (though I do thank TimFerris for lending me his time). Please have a look anyone and see if you can find what is wrong.
I want to see how many sessions are currently open, and at the same time, find each remote ip address. I can get the number of sessions at any one time, but when I loop thru my array (which is actually an application variable), I can only see the latest ip address but the correct num of sessions. The other ip addresses are blank. Can you please take a look at my code? Any suggestions would be helpful.
***********************************************************
global.asa below
************************************************************
<script language="vbscript" runat="server">
sub Application_OnStart
application("USERS"=0
dim urls(0)
application("URLS"=urls
end sub
sub session_onstart
session.timeout=1
session("Start"=now
application.lock
application("USERS" = application("USERS" + 1
size=application("USERS"
redim preserve urls(size-1)
application.unlock
application.lock
urls(size-1)=request.servervariables("REMOTE_ADDR"
application("URLS"=urls
application.unlock
end sub
sub session_onend
application.lock
application("USERS"=application("USERS" - 1
application.unlock
redim urls(size-1)
session("URL"=request.servervariables("REMOTE_ADDR"
urls(size-1)=session("URL"
application("URLS"=urls
end sub
</script>
************************************************************
page displaying sessions/ip addresses below
************************************************************
<!-- #include virtual="/global.asa" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<%
response.write ("This many sessions are open: " & application("USERS" & "<br>"
dim counter
for counter=0 to ubound(application("URLS")
response.write counter & ": " & application("URLS"(counter) & "<br>"
next
%>
</BODY>
</HTML>
************************************************************
Hopefully you can figure out my mess.
Mike
I want to see how many sessions are currently open, and at the same time, find each remote ip address. I can get the number of sessions at any one time, but when I loop thru my array (which is actually an application variable), I can only see the latest ip address but the correct num of sessions. The other ip addresses are blank. Can you please take a look at my code? Any suggestions would be helpful.
***********************************************************
global.asa below
************************************************************
<script language="vbscript" runat="server">
sub Application_OnStart
application("USERS"=0
dim urls(0)
application("URLS"=urls
end sub
sub session_onstart
session.timeout=1
session("Start"=now
application.lock
application("USERS" = application("USERS" + 1
size=application("USERS"
redim preserve urls(size-1)
application.unlock
application.lock
urls(size-1)=request.servervariables("REMOTE_ADDR"
application("URLS"=urls
application.unlock
end sub
sub session_onend
application.lock
application("USERS"=application("USERS" - 1
application.unlock
redim urls(size-1)
session("URL"=request.servervariables("REMOTE_ADDR"
urls(size-1)=session("URL"
application("URLS"=urls
end sub
</script>
************************************************************
page displaying sessions/ip addresses below
************************************************************
<!-- #include virtual="/global.asa" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<%
response.write ("This many sessions are open: " & application("USERS" & "<br>"
dim counter
for counter=0 to ubound(application("URLS")
response.write counter & ": " & application("URLS"(counter) & "<br>"
next
%>
</BODY>
</HTML>
************************************************************
Hopefully you can figure out my mess.
Mike