apologies for top-posting, i just need to get this rant out of the way
first:
sebastian - please make sure you quote the message to which you
replying in such a way as to make any further comments
understandable... for this reason i've inserted the original question
below, indented with pipes (|)
On Fri, 23 Jul 2004 19:50:34 +0200, Sebastian Lauwers
<?dacrashanddie?no?@?spam?9online.fr?> wrote:
|PHP:
| unset($_SESSION['mainDisplay']);
|
|In my original environment (PHP 4.3.2) this line will delete the
|session variable 'mainDisplay'. But in the testing environment (PHP
|4.3.6) the variable persists even after unset() is called.
|
|Is there some special setting in PHP that can allow a session to
|persist even if you attempt to delete it? I am only able to delete the
|session variable upon closing the browser and rebooting computer.
<?php
session_start();
if (isset ($_SESSION['mainDisplay']) ) {
$_SESSION['mainDisplay'] = array();
}
?>
and how is this meant to help?
the OP asked why his $_SESSION variable was not getting unset when he
asked it to ... assigning an empty array to the variable in question
is /not/ really a fix to the problem.
OP: RTM (
http://www.php.net/manual/en/function.unset.php)
specifically the User Contributed Notes as follows:
[quote php.net]
andre at twg dot com dot au
07-Mar-2004 02:16
Only This works with register_globals being 'ON'.
unset( $_SESSION['variable'] );
The above will not work with register_globals turned on (will only
work outside of a function).
$variable = $_SESSION['variable'];
unset( $_SESSION['variable'], $variable );
The above will work with register_globals on & inside a function
[/quote php.net]