![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How could I set it up so I can look at a page on our site and see a count of the current users on the site? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
.oO(Brandon) How could I set it up so I can look at a page on our site and see a count of the current users on the site? Define "current user". HTTP is a stateless protocol. A user sends a request, the server answers and then the user is gone. Micha |
#5
| |||
| |||
|
|
I don't know for sure . . . I've just seen sites that show the "current users" and was interested in doing something like that. How do they do it? |
#6
| |||
| |||
|
|
On 04 Nov 2005 in macromedia.dreamweaver, Brandon wrote: I don't know for sure . . . I've just seen sites that show the "current users" and was interested in doing something like that. How do they do it? If people are logging in, you could keep a separate database of who logged in and output that. As Micha notes, though, HTTP is a stateless protocol (ie no persistent connections). So as soon as it is posted, it's out of date. Assuming you're setting a cookie for logins which times out: - when they log in, write their username and timeout time from the cookie to a database table - if they log out, look for their name and delete the record from the table - before you write the 'who's logged in' to the page, filter it for expired logins and delete them Programming is left as an exercise for the reader... -- Joe Makowiec http://makowiec.net/ Email: http://makowiec.net/email.php |
#7
| |||
| |||
|
|
Regarding the stateless connection . . . I've read other places that the current users can be established by editing the global.asa file which creates a session for every user . . . and the total users can be tracked this way. |
#8
| |||
| |||
|
|
.oO(Brandon) Regarding the stateless connection . . . I've read other places that the current users can be established by editing the global.asa file which creates a session for every user . . . and the total users can be tracked this way. The only way to track users is to have a login. But even this is unreliable, since you don't know if the user is still there or just forgot to logoff. The same applies to sessions. A script like above will only show the number of active sessions, which is rather meaningless. And after all such information is as useless as a hit counter, IMHO. Micha |
#9
| |||
| |||
|
|
Active sessions should for the most part equal active users. |
#10
| |||
| |||
|
|
.oO(Brandon) Active sessions should for the most part equal active users. Usually active sessions > active users. What's the point about that at all? Why do you need it? Micha |
![]() |
| Thread Tools | |
| Display Modes | |
| |