how to logout session if user idle in php

前端 未结 3 1836
小鲜肉
小鲜肉 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条回答
  •  难免孤独
    2020-12-09 07:31

    You can config the PHP - configuration for session.cookie_lifetime, this will automatic destroy session after amount of idle time.
    More information can be found here http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime

提交回复
热议问题