By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,120 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

How determine that the visitor is leave

P: n/a
How do you determine (on the client, on the server) that the visitor leave
the site?

http://www.alvas.net - Audio tools for C# and VB.Net developers
Jan 21 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Alexander Vasilevsky" <ma**@alvas.netwrote in message
news:fn***********@behemoth.volia.net...
How do you determine (on the client, on the server) that the visitor leave
the site?
There is no reliable way to do this due to the disconnected architecture of
the web...

A client sends a request to a server.
The server processes the request and sends a response back to the client.
The server has no knowledge of what happens after that until / unless it
receives another request from the same client.

There are suggested options using the onunload / onbeforeunload JavaScript
events, but they cannot be guaranteed to work either...

My advice would be don't even bother...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 21 '08 #2

P: n/a
I've tried things like calling to them ( "Vistor? Are you still there?") but
that doesn't seem to work either.

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Alexander Vasilevsky" wrote:
How do you determine (on the client, on the server) that the visitor leave
the site?

http://www.alvas.net - Audio tools for C# and VB.Net developers
Jan 21 '08 #3

P: n/a
You could have some fun and use "IsClientConnected" :

http://msdn2.microsoft.com/en-us/lib...connected.aspx

There's one thing I've never been able to figure out about IsClientConnected.
Isn't *being connected* a pre-requisite to it being used ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:4B**********************************@microsof t.com...
I've tried things like calling to them ( "Vistor? Are you still there?") but
that doesn't seem to work either.

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Alexander Vasilevsky" wrote:
>How do you determine (on the client, on the server) that the visitor leave
the site?

http://www.alvas.net - Audio tools for C# and VB.Net developers


Jan 21 '08 #4

P: n/a
AFAIK. it just allows to see if the destination of the current HTTP response
is still connected. For example if a user triggers a long running page and
closes its browser (or just goes on another page on the same site), my
understanding is that IsClientConnected will be false as the network link
between the server sending the response and the "destination" of this
response is broken.

It just allows to see if the response that is currently sent has a receiver
on the other side of the network link

--
Patrice

"Juan T. Llibre" <no***********@nowhere.coma écrit dans le message de
news: uj**************@TK2MSFTNGP05.phx.gbl...
You could have some fun and use "IsClientConnected" :

http://msdn2.microsoft.com/en-us/lib...connected.aspx

There's one thing I've never been able to figure out about
IsClientConnected.
Isn't *being connected* a pre-requisite to it being used ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in
message
news:4B**********************************@microsof t.com...
>I've tried things like calling to them ( "Vistor? Are you still there?")
but
that doesn't seem to work either.

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Alexander Vasilevsky" wrote:
>>How do you determine (on the client, on the server) that the visitor
leave
the site?

http://www.alvas.net - Audio tools for C# and VB.Net developers



Jan 22 '08 #5

P: n/a
re:
!AFAIK. it just allows to see if the destination of the current HTTP response is still connected

I'm well aware of that.

I'll also bet that 99.9999% of all clients are still connected when IsClientConnected is used.
After all, IsClientConnected is checked only in response to a client request for a page.

Most page processing, btw, takes very little time.

A client would have to have very nimble fingers to close the browser
or move to another page before his latest request is fulfilled.

The intended purpose, of course, is to save server resources by not continuing
to process a request which will have no destination, but it seems to me that
IsClientConnected takes up a lot of server resources by itself.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Patrice" <http://www.chez.com/scribe/wrote in message news:Oi**************@TK2MSFTNGP03.phx.gbl...
AFAIK. it just allows to see if the destination of the current HTTP response is still connected. For example if a user
triggers a long running page and closes its browser (or just goes on another page on the same site), my understanding
is that IsClientConnected will be false as the network link between the server sending the response and the
"destination" of this response is broken.

It just allows to see if the response that is currently sent has a receiver on the other side of the network link

--
Patrice

"Juan T. Llibre" <no***********@nowhere.coma écrit dans le message de news: uj**************@TK2MSFTNGP05.phx.gbl...
>You could have some fun and use "IsClientConnected" :

http://msdn2.microsoft.com/en-us/lib...connected.aspx

There's one thing I've never been able to figure out about IsClientConnected.
Isn't *being connected* a pre-requisite to it being used ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in message
news:4B**********************************@microso ft.com...
>>I've tried things like calling to them ( "Vistor? Are you still there?") but
that doesn't seem to work either.

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Alexander Vasilevsky" wrote:

How do you determine (on the client, on the server) that the visitor leave
the site?

http://www.alvas.net - Audio tools for C# and VB.Net developers




Jan 22 '08 #6

P: n/a
Wanted to mention this to point out that this is unlikely to solve the OP
problem... IMO the OP best bet would be to explain what he wants to do i.e.
why he needs to track down leaving visitors.

For example in most cases, it's likely the current user count seen on some
site is just an approximation. If this is for cleanup, cleanup could likely
be done another way etc.. etc...

--
Patrice

"Juan T. Llibre" <no***********@nowhere.coma écrit dans le message de
news: eH**************@TK2MSFTNGP05.phx.gbl...
re:
!AFAIK. it just allows to see if the destination of the current HTTP
response is still connected

I'm well aware of that.

I'll also bet that 99.9999% of all clients are still connected when
IsClientConnected is used.
After all, IsClientConnected is checked only in response to a client
request for a page.

Most page processing, btw, takes very little time.

A client would have to have very nimble fingers to close the browser
or move to another page before his latest request is fulfilled.

The intended purpose, of course, is to save server resources by not
continuing
to process a request which will have no destination, but it seems to me
that
IsClientConnected takes up a lot of server resources by itself.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Patrice" <http://www.chez.com/scribe/wrote in message
news:Oi**************@TK2MSFTNGP03.phx.gbl...
>AFAIK. it just allows to see if the destination of the current HTTP
response is still connected. For example if a user triggers a long
running page and closes its browser (or just goes on another page on the
same site), my understanding is that IsClientConnected will be false as
the network link between the server sending the response and the
"destination" of this response is broken.

It just allows to see if the response that is currently sent has a
receiver on the other side of the network link

--
Patrice

"Juan T. Llibre" <no***********@nowhere.coma écrit dans le message de
news: uj**************@TK2MSFTNGP05.phx.gbl...
>>You could have some fun and use "IsClientConnected" :

http://msdn2.microsoft.com/en-us/lib...connected.aspx

There's one thing I've never been able to figure out about
IsClientConnected.
Isn't *being connected* a pre-requisite to it being used ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Peter Bromberg [C# MVP]" <pb*******@yahoo.NoSpamMaam.comwrote in
message
news:4B**********************************@micros oft.com...
I've tried things like calling to them ( "Vistor? Are you still
there?") but
that doesn't seem to work either.

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Alexander Vasilevsky" wrote:

How do you determine (on the client, on the server) that the visitor
leave
the site?
>
http://www.alvas.net - Audio tools for C# and VB.Net developers
>
>
>



Jan 22 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.