Date: 06/20/01
- Next message: Andi Gutmans: "[PHP-DEV] 4.0.6"
- Previous message: rasmus <email protected>: "[PHP-DEV] Bug #11578 Updated: http header order not respected and messages not transmitted"
- In reply to: cynic <email protected>: "[PHP-DEV] Bug #11527 Updated: session_unregister() seems not work properly"
- Next in thread: Cynic: "Re: [PHP-DEV] Bug #11527 Updated: session_unregister() seems not work properly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm confused now.
1. register_globals=On -> This doesn't work: $HTTP_SESSION_VARS="value"
2. register_globals=Off -> This doesn't work: $varname="value"
what is this? I understand case 2 but the case 1 ???
Aren't the global arrays supposed to work ALWAYS?
With register_globals=off, the unregister/unset works after
the third example script of this bug report is reloaded, with
register_globals=On it works as expected.
All this with PHP 4.0.6RC4, btw.
Am I hallucinating?
--Jani
On 20 Jun 2001 cynic <email protected> wrote:
>ID: 11527
>Updated by: cynic
>Reported By: ccjeagle <email protected>
>Old-Status: Closed
>Status: Open
>Bug Type: *Session related
>Operating system:
>PHP Version: 4.0.5
>Assigned To:
>Comments:
>
>Hi Jani,
>
>does your comment mean register_globals off is deprecated? I don't think so. :)
>
>Previous Comments:
>---------------------------------------------------------------------------
>
>[2001-06-19 12:26:29] sniper <email protected>
>You should be using this:
>
>$somevar = "abc";
>
>Not the globals array.
>
>Works for me with PHP 4.0.6RC3 just fine then.
>
>http://www.php.net/~andi/php-4.0.6RC3.tar.gz
>
>
>
>---------------------------------------------------------------------------
>
>[2001-06-18 21:24:42] ccjeagle <email protected>
>> Yes, when you unregister something,
>> you also need to unset it if you want it
>> to be unset immediately.
>
>Maybe I was wrong, but "Unregister" takes place in the
>SECOND script, and the THIRD one still record the
>"unregistered" variable ????
>
>
>
>---------------------------------------------------------------------------
>
>[2001-06-18 08:56:39] sniper <email protected>
>Yes, when you unregister something, you also need to unset
>it if you want it to be unset immediately.
>
>
>---------------------------------------------------------------------------
>
>[2001-06-17 21:41:40] ccjeagle <email protected>
>Well I found a solution. Just replace session_unregister()
>by unset() statement.
>
>---------------------------------------------------------------------------
>
>[2001-06-17 20:06:04] ccjeagle <email protected>
>It seems that session_unregister() should "remove" a var
>from the session, isn't it ?
>
>-------test.php
><?php
>// First script, register the var
>session_start() ;
>session_register("somevar") ;
>$HTTP_SESSION_VARS["somevar"] = "abc" ;
>?>
><a href="test2.php">Click Here</a>
>
>-------test2.php
><?php
>// Second script, unregister the var
>session_start() ;
>echo "somevar is " . $HTTP_SESSION_VARS["somevar"] ;
>session_unregister("somevar") ;
>?>
><br><a href="test3.php">Click here again</a>
>
>--------test3.php
><?php
>// The third script, see the result
>session_start() ;
>print_r($HTTP_SESSION_VARS) ;
>session_unset() ;
>print_r($HTTP_SESSION_VARS) ;
>session_destroy() ;
>?>
>
>With the enable-trans-sid turned on, the result of the third
>script is :
>Array ( [somevar] => abc ) Array ( )
>
>Is it a bug ?
>How shoud I do if I want to "remove" some variables from
>session but KEEP THE OTHERS unchanged ?
>
>Best Regards
>
>---------------------------------------------------------------------------
>
>The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online.
>
>
>ATTENTION! Do NOT reply to this email!
>To reply, use the web interface found at http://bugs.php.net/?id=11527&edit=2
>
>
>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andi Gutmans: "[PHP-DEV] 4.0.6"
- Previous message: rasmus <email protected>: "[PHP-DEV] Bug #11578 Updated: http header order not respected and messages not transmitted"
- In reply to: cynic <email protected>: "[PHP-DEV] Bug #11527 Updated: session_unregister() seems not work properly"
- Next in thread: Cynic: "Re: [PHP-DEV] Bug #11527 Updated: session_unregister() seems not work properly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

