Forum Moderators: coopster

Message Too Old, No Replies

Detecting Multiple Sessions

         

djchris

8:10 am on Feb 20, 2004 (gmt 0)



Hi,

I have an address database running on POSTGRESQL web based ofcourse with php. My Web application has a login page that gives the users a session_start if their data is correct. Users can login at the same time. I would like to know how i can detect the session from these users. Than i want to know:

- How many user are online
- Wich users are online

When they didn't logged out but have closed their browser, how can i detect if their offline?

Chris

webadept

10:28 am on Feb 20, 2004 (gmt 0)

10+ Year Member



I did this once about 2 years back? maybe.. a year.. anyway, I used Flash to do this, with ActionScript. The flash program itself was only 3k or so, the user never felt the load. It "Pinged" the server with the IP address and browser type, as well as the user name it was serving. The little guy was on every page in the site.

This program I made was to keep others from using the same account at the same time from different IP addresses. The idea the client had was that two or more browser windows open on a single machine to the site was fine, he just didn't want guys giving the access to his friends.

The CGI I used to talk with the flash box was a PHP but you could use anything really, Perl, Python, whatever. Since then I've used this same setup for a number of differnt interactive programs. Flash is very cool for this, when there is nothing but code in there. It also has the added advantage of using the client (the visitors computer) for a great deal of the processing, and saves the server some processor cycles.

I've heard of other methods, but none of them compared to this one.

Glenn Hefley