Re: List of sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:

While we're on the subject of listing sessions, what does the following code do?

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("<pre>");
echo "Session [" . substr($filename, 5) . "]\n";
				  print_r($session);
				  echo "\n--\n\n";
				  echo("</pre>");
				}
		  }
	}

It looks dangerous.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux