[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

On Exit

Posted on 1999-01-06
8
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Accepted Solution

by:
jbrugman earned 600 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
 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

656 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