Reply to Re: Checking to see if a user is logged in

Your name:

Reply:


Posted by Oli Filth on 04/21/06 17:17

tomhawkins1@gmail.com wrote:
> I need to be able to check remotely whether a user is logged in or not.
>
> My current log in script saves various bits of data to a session
> (including a user id). I need to find out via an admin script which
> users are currently logged in ie their $_SESSION['theuserid'] exists in
> any of the existing sessions.
>

$_SESSION variables are not sharable between PHP instances/sessions.
To get this information, you would either have to parse the contents of
the sessions folder (probably pretty hard to do), or write a customised
session handler, which logs information to a database (setting a flag
in the user's record, for instance). You can then access that database
to find who is logged in/out.

See http://php.net/session_set_save_handler et al.


--
Oli

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация