Here's a test you can try yourself.
On your server, set up these two files:
test.php
--------
<?php
session_start();
if ($_REQUEST['var']) $_SESSION['var'] = $_REQUEST['var'];
?>
<pre><?php print_r($_SESSION); ?></pre>
<a href="test-unset.php">Click here to unset</a><br />
<a href="test.php?var=value">Click here to set</a>
test-unset.php
--------------
<?php
session_start();
unset($_SESSION['var']);
session_write_close();
header("Location: test.php"));
exit();
?>
What's supposed to happen: You click on the set link, this sets the
variable. You then click on the unset link. This loads another page
which unsets the variable, saves the session, then returns you to the
original page through a redirect.
This does not happen. When you return to test.php, the _SESSION variable
remains. Why?
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php