read session data without starting session

From: Date: Wed, 26 Nov 2003 18:33:51 +0000
Subject: read session data without starting session
Groups: php.general 
Request: Send a blank email to php-general+get-171121@lists.php.net to get a copy of this message
I have a script that browses a sessions table and extracts and displays the session values for display. The function below (I don't remember where I got it) extracts session data without starting a session, but it doesn't handle session values that are arrays. Anyone have something like this that works? function sess_string_to_array($sd) { $sess_array = array(); $vars = preg_split('/[;}]/', $sd); for ($i=0; $i < sizeof($vars); $i++) {
      $parts = explode('|', $vars[$i]);
      $key = $parts[0];
      $val = unserialize($parts[1].";");
      $sess_array[$key] = $val;
} return $sess_array; } aw

« previous php.general (#171121) next »