-5

Possible Duplicate:
Best way to detect when user leaves a web page
Check if user closed the page in PHP?

i did not find my answer by viewing other question.

As i wanted to make online chat application for my web site

Many answers says that store users status to 1 so that we can identify who is login

on Logut i will make status to 0

yes this is good idea but my confusion is that if someone not logut and close the browser or user's session expire in anyway how do i set status to 0

Community
  • 1
  • 1
Bhavik Patel
  • 21
  • 1
  • 6
  • This has been asked *many* times before on StackOverflow. – richsage May 07 '12 at 08:44
  • yes i know but it can no gave my answer – Bhavik Patel May 07 '12 at 08:44
  • @richsage if you know this has been many times so provide me link here – Bhavik Patel May 07 '12 at 08:46
  • see [here](http://stackoverflow.com/questions/1992753/check-if-user-closed-the-page-in-php), [here](http://stackoverflow.com/questions/147636/best-way-to-detect-when-user-leaves-a-web-page) and [here](http://stackoverflow.com/questions/887919/how-to-detect-if-the-user-is-logout-in-php) – richsage May 07 '12 at 08:50

2 Answers2

0

Have a look here: http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/324675/help-needed-please-update-database-on-browser-close. I think this is what you are after.

w0051977
  • 15,099
  • 32
  • 152
  • 329
0

Make the server ping the client regularly.

Joel
  • 3,427
  • 5
  • 38
  • 60