Solved

On Exit

Posted on 1999-01-06
8
139 Views
Last Modified: 2010-04-09
Hi experts,
  I like to ask how can I detect in my asp codes when
user left my asp page .
  I would like to delete the users record in the database
  when he leave the page .
0
Comment
Question by:seahpc
8 Comments
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1841417
you could try something with the onunload event-handler of the BODY tag, but why not saving (on each page) the "last-seen" time of the user, and (via a server-side process) deleting all entries with a "last-seen" date older than -say 30 minutes.
unfortunately, there is no way of detecting if some completely other page is loaded in the browser - or the browser is closed.
If you use MPS, you can set the delete time for old UIDs on a very low value.
0
 
LVL 1

Expert Comment

by:acsmith
ID: 1841418
are we talking about a user leaving a specific page or leaving your site altogether? if it's leaving the site altogether, you can use the session_onend sub in global.asa to do the cleaning up, although depending on how they leave, it may not get called until the session times out (default 20 mins).
0
 
LVL 5

Expert Comment

by:nathans
ID: 1841419
What are we trying to do?
0
 
LVL 4

Accepted Solution

by:
jbrugman earned 200 total points
ID: 1841420
Try JavaScript:
<BODY onUnload="JavaScript:alert('bye')">
if that won't work:
<BODY onUnload="alert('bye')">
or:
<meta http-equiv="Page-Exit" content="what to do"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1841421
seahpc, are you still following this discussion?
0
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1841422
no comments on jbrugman's answer (as it doesn't quite help you with the problem)?
0
 
LVL 4

Expert Comment

by:jbrugman
ID: 1841423
well, it's only to detect when someone extis. Then you can erase that one from the database.
0
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1841424
no offense, but using client-side JavaScript, that's not too easy - and the user could also exit to another page within the system, so I was wondering why seahpc was satisfied with this solution.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Library to convert HTML to PDF. 8 57
Bootstrap Columns not Side-by-Side 3 36
Enter key on html form page 11 48
How can I convert HTML files to .pdf files? 9 29
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now