cab wrote on 08 jun 2004 in microsoft.public.inetserver.asp.general:
i have the following code in the "Sub Session_OnEnd" routine that does
not seem to run.....
Sub Session_OnEnd
strConnect = "Driver={SQL Server};Server=SERVER;Database=database;
User
ID=xxxxxx;Pwd=xxxxxxx"
Set objConnEnd = Server.CreateObject("ADODB.Connection")
objConnEnd.Open strConnect
strDelete = "DELETE formdata WHERE formMyCpsID = " &
Session.SessionID objConnEnd.Execute
strDelete objConnEnd.Close
Set objConnEnd = Nothing
End Sub
...can I access the Session.SessionID at this stage or has it already
been killed?
I don't know, but you could test this by global.asa:
Sub Session_OnEnd
application("testing") = Session.SessionID & "-!-"
End Sub
===============
In an asp-page test this with:
if application("testing") = "" then
respons.write "No session ended yet. Please try later."
elseif application("testing") = "-!-" then
respons.write "Session.SessionID not available in Session_OnEnd"
else
respons.write "Yes, Session.SessionID is available in Session_OnEnd"
end if
================
not tested ;-}
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)