• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 654
  • Last Modified:

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

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
countrymeister
Asked:
countrymeister
  • 3
  • 2
1 Solution
 
robastaCommented:
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
 
countrymeisterAuthor Commented:
So can you initiate anything in js within a webpage to see if the process hosting is being killed.
0
 
robastaCommented:
i dont want to rule it out completely but i dont think you can.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
mahmoodvcsCommented:
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
 
countrymeisterAuthor Commented:
mahmoodvcs:

Do you have any links or examples that I can look at
0
 
countrymeisterAuthor Commented:
Need points refunded, get some hal bked answers here
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now