Im making a forum which displays the names of all online users by using "SELECT tblUsers.alias FROM tblUsers WHERE tblUsers.status='online'". But then I need to change there status when they close the browser or the session timesout. Is there another way around it than using session_onEnd because I heard that isnt very reliable, also if i do use this can I still get session variables inside the onEnd function?
To end a session when the user closes the browser window you need to add a new page to your site. For example, add a page named sessEnd.asp. This page should need only one line of code:
You can also add some extra html here and use it as the target of a Logout link from anywhere in your site. From a link the page will display. From the code example below, it will not show, but will execute.
<form ACTION="sessEnd.asp" METHOD="post" id="sessEnd" name="sessEnd">
The Session_OnEnd event occurs whenever Session.Abandon is explicitly called or when the current session times out due to inactivity. This is usually 20 minutes by default.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)