 
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("currentcount") = 0
Application("userid")=session("userid")
End Sub

Sub Session_OnStart
 Session.Timeout = 20
 Session("Start") = Now
 Application("userid")=session("userid")

End Sub

 Sub Session_OnEnd

 
Dim ConnectionString
Dim SQLStatement
Dim aConnection
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=" & Server.MapPath("..") & "\matrimonial\data\matrimonial_db.mdb;Jet OLEDB:Database Password=admin#@!;"
  SQLStatement = "UPDATE tbl_profiles SET online=false WHERE user_id_fk ="&Application("user_id_fk")&""
  Set aConnection = Server.CreateObject("ADODB.Connection")
  aConnection.Open(ConnectionString)
  aConnection.Execute(SQLStatement)
  aConnection.Close()
  Set aConnection = Nothing 

End Sub
</SCRIPT>




