Re: $_session/$_cookie trouble

From: Date: Tue, 28 Apr 2009 23:31:17 +0000
Subject: Re: $_session/$_cookie trouble
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-292117@lists.php.net to get a copy of this message
Gary wrote: > Thanks again, dont see any DOM.... > > As I mentioned I am no longer getting error message, but not sure it is > working. > > I have this at the begining of the first file. > > <?php > session_start(); > setcookie('sale_cookie','$sale_value', time()-3600); > setcookie('assess_cookie','$assess_value', time()-3600); > > if (isset($_COOKIE['sale_cookie']) && > isset($_COOKIE['assess_cookie'])) > { > $_SESSION['sale_value'] = $_COOKIE['sale_cookie']; > $_SESSION['assess_value'] = $_COOKIE['assess_cookie']; > } > > ?> > > > > I have tried this > > echo $sale_value; > echo $_SESSION['assess_value']; > echo $_COOKIE['sale_cookie']; > > I have also removed all of the if() and still not had success > > None of which are producing results... > > Anyone see where I am going wrong... I have spent all day online, in the > books, in the manual... > > Thanks again > > gary Maybe I'm missing something, but why are you using session vars and cookie vars like you are? If you start a session it creates a cookie to track the session and the session persists your session vars. Why not just use session vars? -- Thanks! -Shawn http://www.spidean.com

« previous php.general (#292117) next »