Re: PHP 4.0.4pl1 and $HTTP_SESSION_VARS



On 16 Sep, 22:53, donb <donbe...@xxxxxxxxx> wrote:
Oops, I had originally posted this inquiry with the wrong info in the
subject line...
--------------------------------------------------------------------------- ----------------------------------------
Bleah.  I have no recourse but to do something on aa archaic
server...

I want to set a session variable and have it 'live' through the
session lifetime.  I do this:

<?php
        session_start();

        $HTTP_SESSION_VARS['FRED'] = "ETHYL";

        var_dump($HTTP_SESSION_VARS);
?>

and 'FRED' is var_dumped.

I comment out the assignment statement and reload the page, the
var_dump has zero elements.

I've never touched a version of PHP so old so I'm clueless why this
is.  I understand the 'superglobal' difference, and that
$HTTP_SESSION_VARS isn't 'super' like $_SESSION.

I tried adding session_register('FRED') but still no joy.

How the heck to session variables work on 4.0.4pl1?  I'm starting to
think they don't!  It looks like $HTTP_SESSION_VARS is behaving as an
ordinary variable - like I'm not setting anything in the session at
all.

I did check session_id() when repeating the above code, and the
session ids are the same both times, so clearly I am creating and
using a single session.

I know I'm baffled.  I may also be stupid.  Am I doing something
stupidly wrong?

Can't say I've used one that old either but have you tried:
<?php
global $HTTP_SESSION_VARS;
session_start();
$HTTP_SESSION_VARS['FRED'] = "ETHYL";
var_dump($HTTP_SESSION_VARS);
?>
.