Problem with end of Session cleanup

Results 1 to 2 of 2

Thread: Problem with end of Session cleanup

  1. #1
    Join Date
    Dec 1969

    Default Problem with end of Session cleanup

    Hi,<BR><BR>I am building a system that records the current users data temporarily in a table called tblCurrentUser. At the end of the session I want to delete the record to clean up so I put a sub in the global.asa.<BR><BR>I imagine session variable scope lasts through this event but my record is not deleted. Can anyone see any problems. Note that I&#039;m not veryy familiar with global.asa so if you see any unrelated issues please point them out<BR><BR>Here is my code:<BR>------------------------------------------<BR>Sub Session_OnEnd<BR> &#039;remove user from tblCurrent Users<BR> Dim con<BR> &#039;create connection<BR> set con=server.createobject("adodb.connection")<BR><BR > con.mode = 3 &#039;read/write<BR> session("dbConn") &#039;needs to be a session to use generic pages<BR><BR> con.execute("DELETE * FROM tblCurrentUser WHERE token=&#039;"&session("SessRef")&"&#039;;")<BR> SET session("sessref") = Nothing<BR> SET session("LoggedOn") = Nothing<BR> SET session("dbConn") = Nothing<BR><BR>End Sub<BR>------------------------------------------<BR>Note that session("SessRef") is a unique identifier and the key in the tblCurrentUser table<BR><BR>Thanks<BR><BR>Ian

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with end of Session cleanup

    Session_onend is just not reliable, especially for operations any bigger than a few bytes!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts