Solved

How to detect the browser close when the browser is closed from Task Manager

Posted on 2010-11-15
6
642 Views
Last Modified: 2012-05-10
I have a system where I need to see active users, so I created a web page to see the logged in users
In the main ASP.NET application I record the login time when they sign on and logout time when they sign off or the session ends

When the close the browser I need to log them off, (update their logout timestamp)
Hence I need to trap the browser close click , which I do

I have posted previously and found a solution to track the browser click
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_26612638.html
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_26614273.html
http://www.codingforums.com/showthread.php?t=37279

I need to find a way how to update the database when the user goes to Task Manager and kills the browser session any code sample will be great

Please note my app has a login page, master page and few other aspx pages that use the master page.
0
Comment
Question by:countrymeister
[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
  • 3
  • 2
6 Comments
 
LVL 14

Expert Comment

by:robasta
ID: 34142821
But when you click "End Process" in Task Manager it forces the process to terminate. It will lose whatever data hasn't been saved.

This is made worse by the client/server architecture of the web. on the client machine, you can only run client side code (js etc).

If it had been a windows forms app, I would suggest this topic: http://stackoverflow.com/questions/2055753/how-to-gracefully-terminate-a-process.
0
 
LVL 1

Author Comment

by:countrymeister
ID: 34142841
So can you initiate anything in js within a webpage to see if the process hosting is being killed.
0
 
LVL 14

Expert Comment

by:robasta
ID: 34142857
i dont want to rule it out completely but i dont think you can.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 3

Expert Comment

by:mahmoodvcs
ID: 34143896
The only way I think is to use an AJAX request from client every 1 minute or so.
if server didn't receive the request in 5 minutes, then the client is disconnected.
0
 
LVL 1

Accepted Solution

by:
countrymeister earned 0 total points
ID: 34151544
mahmoodvcs:

Do you have any links or examples that I can look at
0
 
LVL 1

Author Closing Comment

by:countrymeister
ID: 34186343
Need points refunded, get some hal bked answers here
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
javascript delete path 7 42
Multiple of Image Swaps 5 41
Difference between Leaflet and MapBox? 5 43
CSS Selector Chain NOT working for this situation? 3 8
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

738 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