Read Session Data
(Chapter 8, Shared Hosting - Pg 77)
<?php
header('Content-Type: text/plain');
session_start();
$path = ini_get('session.save_path');
$handle = dir($path);
while ($filename = $handle->read())
{
if (substr($filename, 0, 5) == 'sess_')
{
$data = file_get_contents("$path/$filename");
if (!empty($data))
{
session_decode($data);
$session = $_SESSION;
$_SESSION = array();
echo "Session [" . substr($filename, 5) . "]\n";
print_r($session);
echo "\n--\n\n";
}
}
}
?>