note 49080 deleted from function.session-start by bjori
| From: | bjori@php.net | Date: | Sun, 16 Apr 2006 00:22:31 +0000 |
| Subject: | note 49080 deleted from function.session-start by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108211@lists.php.net to get a copy of this message | ||
Note Submitter: davidhw at email dot it
----
If you're using $_COOKIE and $_SESSION to pass values from one page to another, do not use the
same keys !
For example:
<page1.php>
<?
session_start();
//
$_COOKIE['key1']="foo";
$_SESSION['key1']="bar";
print($_COOKIE['key1']); //this will display "foo"
print($_SESSION['key1']); //this will display "bar"
//
?>
<page2.php>
<?
session_start();
//
print($_COOKIE['key1']); //this will display "foo"
print($_SESSION['key1']); //this wont display anything!!
//
?>
It took me hour to understand