PHP Multi-User Session Timeout Management -


i'm implementing multi-user system , specific inactivity timeout setting each user.

given :

ini_set('session.gc_maxlifetime',$expire);  

needs called each time before

session_start(); 

so, upon successful login store login time using

$expire = time() + $period ; apc_store('expire', $expire);  

and in each script start use

$expire = apc_fetch('expire') - time() ;  

to compare user expire setting

this works single user, multi-user, since 1 variable stores expire period , overwritten if more 1 user online storing variable each user not work, before session_start() don't know user

any ideas?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -