Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: getting session_onEnd in global asa to work


Message #1 by eric@a... on Fri, 13 Sep 2002 12:40:03
i have this code in my global.Asa to track the end of a session...
Sub Session_onEnd

	Const adCmdTable = &H0002
	dim db
	dim strConn
	strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data 
source=f:\tobiedeprins\datastores\tdp.mdb"
	Set db = Server.CreateObject("ADODB.Connection")
	db.open strConn
	set rsstat=Server.createObject("ADODB.recordset")

	sSQL = "SELECT sessionid,SessionEnd FROM StatsSessions WHERE 
sessionid = " & Session.sessionID 
	rsStat.Open sSQL,db,2,3,adCmdText
	rsstat("sessionEnd")=now
	rsStat.update
	rsStat.close
	db.close

end Sub	
apparantly the end of a session is not tracked when the user closes the 
window...
anyone an idea why?	
Message #2 by "phil griffiths" <pgtips@m...> on Fri, 13 Sep 2002 14:03:14
from MSDN:
"The Session_OnEnd procedure executes only when a user?s session times out 
or when a script explicitly calls the Session object?s Abandon method. "
>---------------------------------------
> i have this code in my global.Asa to track the end of a session...
>...
> apparantly the end of a session is not tracked when the user closes the 
> window...
> anyone an idea why?	

  Return to Index