|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi All,
Is there a way to answer the question: Is client connected? Using CGI? I'd like to know if a client has stopped using/viewing a webpage. thanks, mc_simon |
|
#2
|
||||
|
||||
|
Remember, HTTP is a stateless protocol, meaning you can't positively identify where a request is coming from without some sort of session tracking.
If you really want to figure out how to answer these questions, you'll need to look into tracking sessions and assigning each user a unique ID, whether by cookies, hidden fields, URL encoding, or apache environment variables. Each of these methods has it's own strengths and weaknesses. There are a multitude of modules on CPAN to do this. You may want to do a google search and see what you find elsewhere around the web too. For simplicities sake, look into setting a unique cookie for each user. You could then track the last time the user with that cookie accessed your website, which would give you some idea of whose on your site and when. |
|
#3
|
|||
|
|||
|
I think that I will end up using a session variable along with the time that the person last visited. IF the time is more than an hour (or some other arbitrary time limit) then I will suspect the user is gone.
Another possibility is to use server push? I could push new content to the client until the client hits stop or leaves the site. but is it possible to detect when a user leaves or hits the stop button while server push is happening? Thanks for the reply. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Is client connected? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|