This is a discussion on check if sessions are inactive within the PHP General forums, part of the PHP Programming Forums category; Ok, I've developed a system that allows N number of users to log-in to the site under the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Ok, I've developed a system that allows N number of users to log-in to the
site under the same username/password combo. If a user account has a maximum of 5 possible simultaneous user log-ins, the user stack will be full unless those users logout (which will reduce the stack by one), or their session expires. The problem being that I do not know how to check if a session is active, other than checking the current user session (not all session's currently associated with an account). I am storing all sessions associated with an account. Any ideas? Thanks in advance Christian |
|
|||
|
"cc" <cubadc@earthlink.net> wrote in message news:<xFzVb.16875$jH6.6706@newsread1.news.atl.eart hlink.net>...
> Ok, I've developed a system that allows N number of users to log-in to the > site under the same username/password combo. If a user account has a maximum > of 5 possible simultaneous user log-ins, the user stack will be full unless > those users logout (which will reduce the stack by one), or their session > expires. The problem being that I do not know how to check if a session is > active, other than checking the current user session /** * IsSessionActive() * * @author R. Rajesh Jeba Anbiah * @description Will work only if the session save handler is default "files" implementation & session gc probability is higher * @param $session_id * @return true/false **/ function IsSessionActive($session_id) { $sess_file = session_save_path()."/sess_".$session_id; return(file_exists($sess_file)); } -- "Success = 10% sweat + 90% tears" If you live in USA, please support John Edwards. Email: rrjanbiah-at-Y!com |