check if sessions are inactive

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-08-2004
cc
 
Posts: n/a
Default check if sessions are inactive

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


Reply With Quote
  #2 (permalink)  
Old 02-13-2004
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: check if sessions are inactive

"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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:00 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0