php - Session Expire And Decrease User Status -



create user auth , limitation login (just 2 user can login in same time ) , of things right
when ever session cookie die ( after x time ) , users_status ( in database ) not change ( decrease -1 )
it's meant :
1 - 2 users login website

session_set_cookie_params(60,"/"); // 1 minutes

2 - if user click on logout ( it's fine )
if user waiting , session die , ( user actuley in database not logout )
there way decrease-1 users_status in database !?

thanks helps , sorry poor :( english.

when cookie expires, server not know it. can store active sessions in database or caching solution (like memcache) life times (ttls). can have cron job, checks expired sessions (for instance, once per minute) , decrease must decreased.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -