how to logout session if user idle in php

前端 未结 3 1819
小鲜肉
小鲜肉 2020-12-09 06:45

I am new to php and am trying to build a website. I would like to logout user session if he is idle for some time. I searched the web but i couldn\'t find the proper code. H

3条回答
  •  萌比男神i
    2020-12-09 07:45

    You can use session_cache_expire, I give you this example :

     ";
    
    echo "The cached session pages expire after $cache_expire minutes";
    
    ?>
    

    Source : php.net

提交回复
热议问题