Then, when


is called (even on a variable which is going out of scope) what actually
happens? Where is the data actually stored? I know it isn't in the file yet
(I have session.save_handler = files) because nothing is written to the file
until the script exits. So the memory for xxxx should either be in free
store or on the stack. And, the second question: how can this memory, and
the data it contains, be accessed later in the script (after the
session_register) without having to depend on the original variable being
global or not?

Indeed, it appears that unless the registered variable is global,
session_register will not work.  (Reference my test script appended below,
which can be loaded multiple times with no effect) This is undocumented!

Note: I am not complaining about documentation, I am just trying to
understand what exactly is happening when you register a session variable.


function reg() {
   $test = 13;
   echo "in reg(), test=<$test><br>";

if (!session_is_registered("test")) reg();
echo "HTTP_SESSION_VARS[test] = <".$HTTP_SESSION_VARS["test"]."><br>";

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to