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);
?>
.



Relevant Pages

  • Re: newbie: form with restored field values
    ... I am programming a website with two .php pages: ... WWW and PHP. ... The only thing you need to watch out for is to clear the $_SESSION array elements if they do not go back to the previous page. ... that's what I have read is required for the page to pick up the session variables. ...
    (comp.lang.php)
  • Re: newbie: form with restored field values
    ... I am programming a website with two .php pages: ... On second page POST values are stored in SESSION: ... WWW and PHP. ... required for the page to pick up the session variables. ...
    (comp.lang.php)
  • Re: [PHP] Re: My own "captcha" from 2 years ago......
    ... cause the session variable is being created and set in that second ... script which is called.... ... and the session variables are ...
    (php.general)
  • Re: Hiding variables passed via URL
    ... well you can view cookies as well. ... What else constitutes a 'session variable' apart from POST or GET data ... But then you don't understand that session variables aren't POST or GET ... You could coordinate PHP with Javascript. ...
    (comp.lang.php)
  • Re: Session Variables - why arent novice developers warned?
    ... The user selects a Customer in a browser and enters an order. ... and the same session variables. ... You can research session state very thoroughly without finding any ... with the use of Session Variables? ...
    (microsoft.public.dotnet.framework.aspnet)