Solved

On Exit

Posted on 1999-01-06
8
138 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Column Spacing 3 36
Search box won't work. 22 25
Newbie CSS questions 4 25
HTML CSS 7 18
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
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)

705 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

19 Experts available now in Live!

Get 1:1 Help Now