Solved

On Exit

Posted on 1999-01-06
8
151 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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 i…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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)

707 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