Re: Cookies on WinXP

From: Date: Thu, 31 Jul 2003 23:23:15 +0000
Subject: Re: Cookies on WinXP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157842@lists.php.net to get a copy of this message
--- Steve Buehler <steve@ibapp.com> wrote: > $cookhost=$_SERVER["HTTP_HOST"]; > header("Set-Cookie: aa_host=$cookhost;"); > setcookie ("aa_host", "$cookhost",0,"/","$cookhost"); > setcookie ("aa_host", "localhost",0,"/","localhost"); > setcookie ('aa_host', 'localhost',0,'/','localhost'); ... > I can set the cookie with the "header" line with no problem, > but either one of the "setcookie" lines will not set the cookie. Hi Steve, You're not specifying a hostname in your header() example, but you are in each of the setcookie() examples (and randomly switching between using $cookhost as a value or as a hostname). My advice is to check out http://www.php.net/setcookie and paying close attention to: 1. The order of the parameters 2. The fact that they are not all required Hope that helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/

« previous php.general (#157842) next »