Re: Re: change value of session variable?
| From: | John W. Holmes | Date: | Thu, 22 Jul 2004 05:07:15 +0000 |
| Subject: | Re: Re: change value of session variable? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191473@lists.php.net to get a copy of this message | ||
Five wrote:
---------------------------------------------------- page1.php <?php session_start(); echo 'page #1<br>'; echo $_SESSION['favcolor']; $_SESSION['favcolor'] = 'green'; echo '<br><a href="page2.php">page 2</a>'; ?> ---------------------------------------------------- page2.php <?php session_start(); echo 'page #2<br>'; echo $_SESSION['favcolor']; $_SESSION['favcolor'] = 'blue'; echo '<br><a href="page1.php">page 1</a>'; ?> ----------------------------------------------------This code works exactly the way it's supposed to!! No value first time, then rotating value!! If it does not work for you, are you sure you're accepting the session cookie? How are you sure? Do you have a valid session.save_path? How do you know? Are you displaying errors? How do you know? If you see an SID in the URL when navigating the pages, does it stay the same between pages or change? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com