Bug #14785: cannot save data with session_register() in functions

From: Date: Tue, 01 Jan 2002 06:18:47 +0000
Subject: Bug #14785: cannot save data with session_register() in functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-75478@lists.php.net to get a copy of this message
From: y0rt@hotmail.com Operating system: Debian Linux PHP version: 4.1.0 PHP Bug Type: Session related Bug description: cannot save data with session_register() in functions session_register() doesnt seem to save anything in functions, eg. session_start(); function bob() { $var = "somethinghere"; session_register("var"); } bob(); echo session_encode(); the above only registers the var name, not the data in it. if it helps theres a way around it, all you gota do is make the $var global so instead of having $var have $GLOBALS['var'] and it works fine. might be little bug, but it stuffed me up 4 nights in a row. oh and the way i compiled php was just with apt-get install php4 in debian, (newbie here) -- Edit bug report at: http://bugs.php.net/?id=14785&edit=1

« previous php.dev (#75478) next »