troubleshooting Question

Perform action on session timeout

Avatar of rcmb
rcmb asked on
ASP
4 Comments1 Solution385 ViewsLast Modified:
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.inc"-->
<%
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros