note 27064 added to function.setcookie

From: Date: Thu, 21 Nov 2002 17:39:42 +0000
Subject: note 27064 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-39824@lists.php.net to get a copy of this message
USING: Windows 2000 Apache Server for Windows 2.0.40 PHP4-win32 IE 5+ This app is specifically built for IE, so I am unaware of any difficulties with Netscape. I kept getting various errors when trying to set a cookie for user login. I was doing generic test, so I was only doing: setcookie("cookieid", $value); Eventually I noticed that the cookie was set in that directory, and all of it's subdirectories, but not in any other directories (parents or siblings). However, on the system with the configuration mentioned above, the cookie needed to be set as follows: setcookie("cookieid", $value, time()+3600, "/"); That allowed the cookie to be used in all directories throughout the site. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+27064 http://master.php.net/manage/user-notes.php?action=delete+27064 http://master.php.net/manage/user-notes.php?action=reject+27064

« previous php.notes (#39824) next »