note 49081 deleted from function.session-start by nlopess

From: Date: Sun, 16 Jan 2005 10:14:09 +0000
Subject: note 49081 deleted from function.session-start by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83403@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

« previous php.notes (#83403) next »