473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How determine that the visitor is leave

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
6 1310
"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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which...
2
by: Imre Palik | last post by:
Hi, I am trying to create a framework, that automatically generates a base class for the visitor pattern: template <typename param, typename ret = void> struct visitor { typedef ret...
12
by: FluffyCat | last post by:
New on November 28, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Visitor Pattern. In the Visitor pattern, one class calls a function in another class and passes an instance of...
17
by: Merlin | last post by:
Probably there is no right or wrong answer to this but I thought to ask to put my mind at rest. Ok lets say you have a object hierarchy (eg. the Glyph in Lexi from GOF book) and you want to use the...
0
by: Siphiuel | last post by:
Hi everyone. When using visitor pattern, we have a nasty dependence on the types of visitable objects that is coded way on top on the visitor hierarchy. i mean, like this: class AbstractVisitor...
18
by: damezumari | last post by:
I would like to know how many of the visitors to my site has js enabled and how many has it turned off. I haven't found a simple solution searching Google groups so I suggest the following using...
1
by: JosAH | last post by:
Greetings, this week we let go of all that algebraic stuff and concentrate a bit more on what object oriented programming is all about. Java claims to support OO, so why not use it? In this...
0
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base...
3
by: aaragon | last post by:
Hello everyone, I've been trying to work with the visitor design pattern, and it works fine except for the following. Let's suppose that we have a fixed hierarchy of classes (many of them)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.