Hey, is there some reason that using something like this isn't working?

        $HTTP_SESSION_VARS['test'] = 'Testing';
        echo $HTTP_SESSION_VARS['test'];

   echo $HTTP_SESSION_VARS['test'];

ie. ses1.php starts a session and registers $test to be a session var and
then I define it in in the $HTTP_SESSION_VARS array.  ses2.php simply
prints the value.  With register_globals turned off this works perfectly,
but with it on it doesn't.

I think the $HTTP_SESSION_VARS approach should work regardless of the
register_globals setting.  Or is there some reason for not having it work
when register_globals is on?

Looks like this code in session.c is the culprit:

int php_get_session_var(char *name, size_t namelen, zval ***state_var PLS_DC PSLS_DC 
        HashTable *ht = &EG(symbol_table);

        if (!PG(register_globals))
                ht = Z_ARRVAL_P(PS(http_session_vars));

        return zend_hash_find(ht, name, namelen + 1, (void **)state_var);

http_session_vars is only checked if register_globals is off.


PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to