[nycphp-talk] $_SESSION
Sexton, David
dsexton at ubspw.com
Thu May 8 16:19:11 EDT 2003
I think this may be it... I'll try the upgrade... thanks a lot!
-----Original Message-----
From: Malcolm, Gary [mailto:gmalcolm at professionalcredit.com]
Sent: Thursday, May 08, 2003 4:16 PM
To: NYPHP Talk
Subject: RE: [nycphp-talk] $_SESSION
more from the manual:
There is a defect in PHP 4.2.3 and earlier. If you register a new session
variable by using session_register(), the entry in the global scope and the
$_SESSION entry will not reference the same value until the next
session_start(). I.e. a modification to the newly registered global variable
will not be reflected by the $_SESSION entry. This has been corrected in PHP
4.3.
> -----Original Message-----
> From: Sexton, David [mailto:dsexton at ubspw.com]
> Sent: Thursday, 08 May, 2003 1:08 PM
> To: NYPHP Talk
> Subject: [nycphp-talk] $_SESSION
>
>
> I'm hoping someone can help me with this... I am running PHP 4.1.2 on
> WINNT4.0 in CGI mode.
>
> All I'm trying to do (as a test), is write data to a session
> object using
> the $_SESSION superglobal, like so:
>
> <?php
> session_register('test_var');
> $_SESSION['test_var'] = "Hello World";
> PRINT $_SESSION['test_var'];
> ?>
>
> The variable 'test_var' registers, but the value 'Hello
> World' does not get
> written. What's even more confusing is that the script prints
> 'Hello World'
> to the screen. It seems like PHP is interpreting
> $_SESSION['test_var'] as a
> custom built associative array, since it is printing the value but not
> storing it in the session file.
>
> Some folks suggested it may be a compatibility issue between
> $_SESSION and
> register_globals = On - So I turned them off and it still
> doesn't work.
>
> The session files are writable if I use the registered
> globals, but that is
> both insecure and a pain because I have to pay attention to
> scope within
> functions.
>
> Anybody have any suggestions on what the problem could be?
>
> Thanks.
>
>
>
>
>
--- Unsubscribe at http://nyphp.org/list/ ---
More information about the talk
mailing list