You are here: Re: Forced user logout / Cancel sessions and cleanup « PHP Programming Language « IT news, forums, messages
Re: Forced user logout / Cancel sessions and cleanup

Posted by Dikkie Dik on 11/18/73 11:40

Using JavaScript, you could use the onunload event of the body to
contact the server to log out. However, that would also log a user out
if he requests another page of the server.
Or, you could keep refreshing a subframe as a "live" signal.


Mickey wrote:
> Hi all,
>
> Currently I use a timestamp to log users out after 15 minutes of
> inactivity.
> However I also need to log a user out if they have just left the page.
> I need to do this because I store current online users in a database,
> allowing a maximum of 5 users at one time.
>
> I have been looking through the php manual and came across
> session_cache_expire(). This isn't doing what I need either. Am I
> going in the wrong direction with this?
>
> Basically my question is, is there a way to log a user out (and clear
> my user_online database) if they just leave the page?
>
> Thanks in advance for any suggestions.
>

 

Navigation:

[Reply to this 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

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