Setting cookies

From: Date: Tue, 30 Sep 2003 17:15:51 +0000
Subject: Setting cookies
Groups: php.general 
Request: Send a blank email to php-general+get-164426@lists.php.net to get a copy of this message
We have 2 servers, one for development and one for production. The development server is "dev.change.wild.net" while the production server is "change.wild.net". We are using the following code to set the cookie $expire_time = time()+60*60*24*30; // 30 days setcookie( 'this', $this, $expire_time, '/', $_SERVER['HTTP_HOST'] ); setcookie( 'that', $that, $expire_time, '/', $_SERVER['HTTP_HOST'] ); We are accessing the cookie values using $_COOKIE. What appears to be happening is that when we echo the values of the above cookies on "dev.change.wild.net", it is displaying the values set for on "change.wild.net". Why is that? Because "change.wild.net" is the primary domain with 'dev' being a subdomain? Is there any way we can force it so that the cookie values are pulled for the correct domain? thnx, Chris

« previous php.general (#164426) next »