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.