Bug #4124 Updated: cookies and headers dont mix
| From: | Bug Database | Date: | Thu, 13 Apr 2000 06:34:22 +0000 |
| Subject: | Bug #4124 Updated: cookies and headers dont mix | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17867@lists.php.net to get a copy of this message | ||
ID: 4124
User Update by: tim.nelson@mindspring.com
Status: Closed
Bug Type: Misbehaving function
Description: cookies and headers dont mix
problem... there is a "bug" with IIS
from microsoft support on Microsoft Internet Information Server versions 3.0, 4.0
BUG: Set-Cookie Is Ignored in CGI When Combined With Location
http://support.microsoft.com/support/kb/articles/Q176/1/13.ASP?LNG=ENG&SA=ALLKB&FR=0
work around...
step 1) prefix name of PHP file with "nph-" as in
nph-mypage.php3
step 2) the nph- prefix tells IIS to not process the headers, so you must build all the headers
yourself. Since we want to redirect and set cookies at the same time, the PHP looks like...
header("HTTP/1.0 302 Redirect");
header("Location: wherever.php3");
setcookie("name","value", $lifetime);
//
Not so simple. Thanks to Patrick for pointing me (although cryptically) in the right direction.
Full Bug description available at: http://bugs.php.net/?id=4124