Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何测试以查看会话是否开启。这不是办法...
session_start(); if(isset($_SESSION)) { echo "sessions ON<br>"; } else{ echo "sessions OFF<br>"; } session_destroy(); if(isset($_SESSION)) { echo "sessions ON<br>"; } else{ echo "sessions OFF<br>"; }
试试这个:
如果(会话ID())
http://php.net/manual/en/function.session-id.php
session_start()如果会话成功启动,它本身将返回布尔值 TRUE,否则返回布尔值 FALSE。
session_start()