Re: more session "bugs"?

From: Date: Thu, 02 May 2002 23:05:38 +0000
Subject: Re: more session "bugs"?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-95793@lists.php.net to get a copy of this message
Pardon the parse error in test-unset.php. change: header("Location: test.php")); to: header("Location: test.php"); Mike Mike Eheler wrote:
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


« previous php.general (#95793) next »