|
Posted by Erwin Moller on 02/27/06 12:27
Mitul wrote:
> Hi to all,
>
> I am working on a site in which I need to check whether user is online
> or not. If user successfully logged out then I can change status from
> online to offline but if user do not logged out and close the browser
> or session timeout then in both of the case I do not handle how to
> change user's status from online to offline.
>
> Please help me to overcome the problem. Looking forward to reply from
> all of you.
>
> With Regards & thanks,
> Mitul Patel
Hi.
AFAIK: The onlt way to implement this is by coding your own sessionhandler,
like Mitul wrote.
It is not rocketscience, but you need to study the mechanism a little first.
It boils dow to:
1) You overwite default (filebased) sessionstorage with your own, probably
databasesessionstorage.
How?
start reading here:
http://nl2.php.net/manual/en/function.session-set-save-handler.php
and surely this:
http://www.zend.com/zend/tut/session.php
2) Now you are in control of the session, you can easily add some extra
functionality to garbagecollection, or sess_open() or wherever you think is
the appropriate place.
Just get the userid out of the session (or store it in the table itself),
and do what you have to do with it, like setting it to not logged in.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|