rcmb
asked on
Perform action on session timeout
I need an example of how to write to a database on session timeout. My session timeout is set to 30 minutes and I need to record an integer in my user database to indicate the user successfully logged out of the system. The system is designed to keep two people from being logged in at the same time using the same login and password. If the session times out then an action needs to occur to do the following:
<!--#include file="../includes/dbconn.i nc"-->
<%
strSQLQuery = "UPDATE Users SET Logout = 0 " _
& "WHERE UserID=" & Session("UserID") & ""
Set rs = Server.CreateObject("ADODB .Recordset ")
rs.Open strSQLQuery, conn, 3, 3
%>
I assume you need to use something like a global.asa file with
Sub Session_OnEnd
....
End Sub
but I have no idea how to incorporate writing to a database from a global.asa file.
This is somewhat urgent!!
Thanks in advance for your help.
RCMB
<!--#include file="../includes/dbconn.i
<%
strSQLQuery = "UPDATE Users SET Logout = 0 " _
& "WHERE UserID=" & Session("UserID") & ""
Set rs = Server.CreateObject("ADODB
rs.Open strSQLQuery, conn, 3, 3
%>
I assume you need to use something like a global.asa file with
Sub Session_OnEnd
....
End Sub
but I have no idea how to incorporate writing to a database from a global.asa file.
This is somewhat urgent!!
Thanks in advance for your help.
RCMB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
NiksonKoh -- Thanks for your help with the global.asa -- I have already found this to be very useful!
RCMB