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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help on logout

Status
Not open for further replies.

ryan1982

Technical User
Jan 20, 2002
38
SG
i've had a problem with logout using asp

situation:

i used a field in the database called "logon" with "yes/no" variable

everytime the user logs in the variable is changed to
login = true

and everytime the user logs out the varible is changed
to login = false

but if the user clicks on the X(top right) in internet
explorer and does not logout,
the login variable remains as true and he/she is not able to login again

i've read a function called window.close but i had probs
using this function ..

i need some help on functions which will be called when the
user click on the X(top right) button in IE
so i can automatically log them out.

i'm just a beginner using asp so pls dun give some
complicated functions or coding , i may not understand them
:)
thanks in advance
 
look at the onUnLoad function of the window.

This will fire off some events before the window closes...

<body language = &quot;vbs&quot; onUnLoad = &quot;sUnLoad&quot;>
<!-- some html stuff here -->
<script language = &quot;vbs&quot;>
sub sUnLoad()
'**********some code to submit a form to the server to change the DB value of logged on
'**********could use the session.abandon here as well if sessions are used in the site...this could call a function to log off the user from the DB.

End Sub
</script>

</body>

hth

bastien Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top