469,927 Members | 1,469 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Problem of user online/ offline status

I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
Dec 19 '07 #1
10 3510
rf

"Php Developer" <ph***************@gmail.comwrote in message
news:6f**********************************@s8g2000p rg.googlegroups.com...
>I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
Er, what? Google grouper, figures.

In any case you can not reliably know when a viewer "stops" looking at your
page. onunload does not work - what if they simply pull the plug on their
computer or wander off down to the pub?

This is asked frequently. Google.

--
Richard.
Dec 19 '07 #2
Hi,
What i need some help to make it work if possible any ways pls tell
Thanks
I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
Dec 19 '07 #3
In article <80**********************************@s12g2000prg. googlegroups.com>, Php Developer <ph***************@gmail.comwrote:
>Hi,
What i need some help to make it work if possible any ways pls tell
What part of 'you can not reliably know when a viewer stops looking at your
page' did you not understand?
Thanks
>I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
Dec 19 '07 #4
On Dec 19, 12:41 pm, Php Developer <php.developer2...@gmail.com>
wrote:
I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
It is impossible to /reliably/ get this information in the way you
want it. But what you're asking for also seems illogical. The fact
that the user has browser away from your page is the *only* indicator
you have. And that isn't reliable - what if the process is killed, or
the connection is dropped by the ISP, or the user has more then one
browser instance at a time open? These conditions all subvert the
notion of being "online" or "offline" as far as your question goes.
Dec 19 '07 #5
Hi,
I know maybe i m not asking unreliable thing but i want a way to make
it work if you know better way thn that then tell.As orkut and
facebook are using this things..
Thanks
On Dec 19, 6:53 pm, seani <ingl...@gmail.comwrote:
On Dec 19, 12:41 pm, Php Developer <php.developer2...@gmail.com>
wrote:
I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.

It is impossible to /reliably/ get this information in the way you
want it. But what you're asking for also seems illogical. The fact
that the user has browser away from your page is the *only* indicator
you have. And that isn't reliable - what if the process is killed, or
the connection is dropped by the ISP, or the user has more then one
browser instance at a time open? These conditions all subvert the
notion of being "online" or "offline" as far as your question goes.
Dec 19 '07 #6
Hi,
I know maybe i m not asking unreliable thing but i want a way to make
it work if you know better way thn that then tell.As orkut and
facebook are using this things..
Thanks

On Dec 19, 6:50 pm, spamb...@milmac.com (Doug Miller) wrote:
In article <8040f325-3e23-47cd-b89e-e029c53a4...@s12g2000prg.googlegroups.com>, Php Developer <php.developer2...@gmail.comwrote:
Hi,
What i need some help to make it work if possible any ways pls tell

What part of 'you can not reliably know when a viewer stops looking at your
page' did you not understand?
Thanks
I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.- Hide quoted text -

- Show quoted text -
Dec 19 '07 #7
On Dec 19, 2:02 pm, Php Developer <php.developer2...@gmail.comwrote:
I know maybe i m not asking unreliable thing but i want a way to make
it work
It isn't possible, as you've been told several times.
if you know better way thn that then tell.As orkut and
facebook are using this things..
Then they lie. The closest you can come is "The user access a page X
seconds ago, they might still be online" (and that involves something
on the server, which could be JavaScript, but probably isn't).
Dec 19 '07 #8
On Dec 19, 8:02 am, Php Developer <php.developer2...@gmail.comwrote:
Hi,
I know maybe i m not asking unreliable thing but i want a way to make
it work if you know better way thn that then tell.As orkut and
facebook are using this things..
Thanks

On Dec 19, 6:50 pm, spamb...@milmac.com (Doug Miller) wrote:
In article <8040f325-3e23-47cd-b89e-e029c53a4...@s12g2000prg.googlegroups.com>, Php Developer <php.developer2...@gmail.comwrote:
>Hi,
>What i need some help to make it work if possible any ways pls tell
What part of 'you can not reliably know when a viewer stops looking at your
page' did you not understand?
Thanks
>I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
facebook is probably just checking that the person is logged in. If
logged in, then they say they're "online". They do this with cookies.
And they probably don't use javascript for this, but some server side
stuff (php, for example) like David mentioned.
Dec 19 '07 #9
On Dec 19, 6:50 pm, spamb...@milmac.com (Doug Miller) wrote:
In article <8040f325-3e23-47cd-b89e-e029c53a4...@s12g2000prg.googlegroups.com>, Php Developer <php.developer2...@gmail.comwrote:
>Hi,
>What i need some help to make it work if possible any ways pls tell
What part of 'you can not reliably know when a viewer stops looking at your
page' did you not understand?
Thanks
>I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.- Hide quoted text -
- Show quoted text -
On Dec 19, 2:02 pm, Php Developer <php.developer2...@gmail.comwrote:
Hi,
I know maybe i m not asking unreliable thing but i want a way to make
it work if you know better way thn that then tell.As orkut and
facebook are using this things..
Thanks
Ok, let's try a different tack; *why* do you want to know if a user is
"online" or "offline", and *what* are you going to use that
information for?
Dec 20 '07 #10
Hi,

"Php Developer" <ph***************@gmail.comwrote in message
news:6f**********************************@s8g2000p rg.googlegroups.com...
I want to know how to check that user is online or offline status if
he close his browser with the help of <body onunload>.As it not work
well if is user change his page as that time it is too fired.I want
only to fire function if user closed browser.
Leaving reliability and cross-browser issues aside for a moment, Java
Applets (sometimes) give you start/stop and init/destroy event notification.

Could be worth a look?

Cheers Richard Maher
Dec 20 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by NohaKhalifa | last post: by
1 post views Thread by Savas Ates | last post: by
1 post views Thread by Stefan Behrens | last post: by
10 posts views Thread by greenb | last post: by
3 posts views Thread by kotori | last post: by
7 posts views Thread by giddy | last post: by
9 posts views Thread by =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post: by
3 posts views Thread by =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.