Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

global.asa session.abandon in session_onstart routine 1

Status
Not open for further replies.

VBRookie

Programmer
May 29, 2001
331
US
Hi,

I have a site I must maintain that is having a problem with users logging in and seeing the wrong information. What's happening is that the user will stop using the site without closing the browser and another user will log in and still see the first user's information.

I know that this is because the previous user's session hasn't expired. I was wondering if I could put the session.abandon command in the session_onstart routine of the global.asa before everything else. For example the following:

Code:
Sub Session_OnStart
     session.abandon
     ' other code here
end sub

I'm thinking that this will annihilate any open session and allow the next user to log in to see the correct information, but I'm wondering if there are any drawbacks to this approach and if this is even doable.

Your help would be very much appreciated.

Thanks,
- VB Rookie
 
How i know is that the user leaves your site his session is automaticaly closed but maybe not so quick...

U cannot use Session.Abandon in Session_OnStart cuz it's just started

but u could try somthing like this
...
<body onunload=&quot;doUnload()&quot;>
...
<script language=&quot;javascript&quot;>
function doUnload()
{
//process unload information
};
</script>

if the unload event is from one click from your page u dont do nothing if this is an IE close or change of addres u could submit somthing that tells u that the user has logout and close the session


 
Thanks I wasn't sure if that was doable.

I think that I have found a work around though by initializing the session variables in the login page as well as the global asa. So if the old session is still active, and the session_onstart event doesn't fire, the variables will still get initialized and reset.

Thanks again for your help,
- VB Rookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top