Session List
<?php
print_r(scandir(session_save_path()));
?>
Check for a Specific Session
<?php
session_start();
echo (file_exists(session_save_path().'/sess_'.session_id()) ? 1 : 0);
?>
Time Session File Last Changed
<?php
session_start();
echo filectime(session_save_path().'/sess_'.session_id());
?>
As has been done to death, already, it isn't best-practice to handle sessions this way but if it's needed, those will work without the need to check/modify the session storage path (useful if you switch to another server with a different configuration).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…