Re: how to see all sessions sets in server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4 Aug 2013, at 14:36, Farzan Dalaee <farzan.dalaee@xxxxxxxxx> wrote:

> I need to inspect each visitor to show how online or who offline for chat
> Like facebook chat

PHP sessions is a really bad mechanism to use to accomplish this. In the past I've used memcached or redis for presence indicators. Both allow you to set keys that expire after a set period. The problem with this is that a user can appear to be online for up to "set period" seconds longer than they actually are.

In the system I'm currently building I've got a node.js daemon to which the browser connects. That daemon exposes an API that the rest of the system can call to get lists of online users, which is easily gathered since it's just the list of connected users. There is then no delay between the browser closing the connection and the daemon deciding that user is no longer online.

If you have a chat system I'm curious as to how it works, since presence is usually tied closely to how the client is detecting new messages.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux