Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 25th, 2001, 11:06 AM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
Cool Is client connected?

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

Reply With Quote
  #2  
Old July 25th, 2001, 06:17 PM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,635 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 44 m 19 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
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.

Reply With Quote
  #3  
Old July 25th, 2001, 08:57 PM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Is client connected?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway