[PHP] Re: more session "bugs"?
register_globals *is* off (I haven't touched a global variable since _SESSION/POST/GET/REQUEST and the like were introduced), and what about this is "wrong behaviour"? Mike Yasuo Ohgaki wrote: > Disable register_globals. Then it should work. > BTW, this is wrong behavior, but it's documented. > > -- > Yasuo Ohgaki > > Mike Eheler wrote: > >> Here's a test you can try yourself. >> >> On your server, set up these two files: >> >> test.php >> >> > session_start(); >> if ($_REQUEST['var']) $_SESSION['var'] = $_REQUEST['var']; >> ?> >> >> Click here to unset >> Click here to set >> >> test-unset.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
[PHP] Re: more session "bugs"?
Disable register_globals. Then it should work. BTW, this is wrong behavior, but it's documented. -- Yasuo Ohgaki Mike Eheler wrote: > Here's a test you can try yourself. > > On your server, set up these two files: > > test.php > > session_start(); > if ($_REQUEST['var']) $_SESSION['var'] = $_REQUEST['var']; > ?> > > Click here to unset > Click here to set > > test-unset.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
[PHP] Re: more session "bugs"?
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 > > session_start(); > if ($_REQUEST['var']) $_SESSION['var'] = $_REQUEST['var']; > ?> > > Click here to unset > Click here to set > > test-unset.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