#20961 [Opn->Fbk]: session_decode causes the script to crash

From: Date: Thu, 12 Dec 2002 15:54:00 +0000
Subject: #20961 [Opn->Fbk]: session_decode causes the script to crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-27493@lists.php.net to get a copy of this message
ID: 20961 Updated by: iliaa@php.net Reported By: mthornton@wei.cc -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Linux/Windows PHP Version: 4.2.3 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2002-12-12 09:53:01] mthornton@wei.cc function get_session_decode($sessStr) { if ($sessStr) { session_decode($sessStr); unset($sessStr); $vars = get_defined_vars(); return $vars; } //if } //func The following function should return an array of session variables: function get_session_decode($sessStr) { if ($sessStr) { session_decode($sessStr); unset($sessStr); $vars = get_defined_vars(); return $vars; } //if } //func print_r(get_session_decode('TEST|s:7:"testing";')); however session_decode always crashes when you pass it a valid session string. It does not crash if you pass it an invalid session string or an empty/false string. I tried using the function by it self, but it still crashes. No sessions where created at the time (which SHOULD NOT be needed). If you call session_start() first, it does not crash, but does not set any variables. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20961&edit=1

« previous php.bugs (#27493) next »