Checking for PHP session without starting one?

后端 未结 3 661
感情败类
感情败类 2021-02-12 20:30

Is it possible to check for a session with out starting one?

The reason that I ask is, the app I am developing has an integrated admin interface. So when an admin is logg

3条回答
  •  甜味超标
    2021-02-12 20:40

    You could check if the PHPSESSID cookie is set (the PHPSESSID name may have another name, depending on your server settings, check ini.session.name).

    But if all you fear is poluting your session dir, you can adjust session.gc_probability, session.gc_divisor and session.gc_maxlifetime to make them disappear faster.

提交回复
热议问题