Re: Session hell: register_globals off
| From: | Randall Perry | Date: | Sun, 04 Apr 2004 19:04:12 +0000 |
| Subject: | Re: Session hell: register_globals off | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182298@lists.php.net to get a copy of this message | ||
Also, this means that each succeeding page that uses and changes the session
variable must read it in at the beginning of the code and reset it to
$_SESSION after changes are made, i.e.:
$order = $_SESSION['order'];
..
..
<code that changes $order>
..
..
$_SESSION['order'] = $order
> Solved my main problem. I was assuming that variables registered with
> $_SESSION were passed by reference. Apparently they're passed by value.
>
> I moved the line '$_SESSION['order'] = $order;' from the top of the page 1
> php code (before any properties for the order object are set), to the end of
> the php code -- now everything's getting passed to page 2 ok.
>
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/