note 31170 added to function.setcookie

From: Date: Fri, 11 Apr 2003 20:26:26 +0000
Subject: note 31170 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-46524@lists.php.net to get a copy of this message
If you experience problems on Microsoft Information Server (IIS) when setting a cookie via PHP and when PHP is running as a CGI binary it is not setting the cookie. After spending many hours on what the problem is here is what happens: When you invoke setcookie and redirect to another page you will not have your cookie set, because it seems that IIS doesn't set the cookie unless you actually send some contents to the browser. Therefore if you want to set a cookie and then redirect to another page you will have to do the redirection via JavaScript and/or HTML if you want your script to work on IIS. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+31170 http://master.php.net/manage/user-notes.php?action=delete+31170 http://master.php.net/manage/user-notes.php?action=reject+31170

« previous php.notes (#46524) next »