From:             [EMAIL PROTECTED]
Operating system: ALL
PHP version:      4.2.2
PHP Bug Type:     Session related
Bug description:  unset( $_SESSION['variable'] ) <- Fails with registered_globals 'on'

Below is the PHP Documentation on unregistering session variables...
------------
Note: If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used,
use unset() to unregister a session variable.
------------
unset( $_SESSION['variable'] ) fails to unset the given session variable
with registered_globals turned 'on' in ini file. It is safe to say that
this is true on all operating systems. PHP versions this was tested on is
4.1.1 and 4.2.2, accross many different operating systems. Using unset(
$_SESSION['variable'] ) will unset the variable on the current page only,
and will not unset it in the global space.

We have come up with a workaround that works fine with registered_globals
on. See Below -->

---------------
unset( $_SESSION['variable'], $variable );
---------------

The above works fine. I believe that the documentation needs to reflect
this problem as countless developers in our community (Forums @ DevShed)
has posted related problems using 'unset( $_SESSION['variable'] )'....

This applies only when registered_globals is truned 'on'.

unset( $_SESSION['variable'] ) works fine with registered_globals 'off'.




-- 
Edit bug report at http://bugs.php.net/?id=19586&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19586&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19586&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19586&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19586&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19586&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19586&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19586&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19586&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19586&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19586&r=globals

Reply via email to