Bug #1111: Set-Cookie not working in IE
| From: | cary at active-ideas dot com dot au | Date: | Tue, 02 Feb 1999 06:15:18 +0000 |
| Subject: | Bug #1111: Set-Cookie not working in IE | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3838@lists.php.net to get a copy of this message | ||
From: cary@active-ideas.com.au
Operating system: Irix 6.5.2
PHP version: 3.0.6
PHP Bug Type: Misbehaving function
Bug description: Set-Cookie not working in IE
We are using PHP as a standalone cgi bin program running various versions of Apache. Even with PHP
3.06 and Apache 1.3.3 this problem still exists.
It appears that Internet Explorer requires the Set-Cookie header tag to be AFTER the Content-Type
line in the header returned by PHP.
When using the setcookie function it has performed correctly when using the Netscape browsers.
Whereas some websites I noticed were correctly setting a cookie in IE3 and IE4. On doing a
comparison of the headers returned (by telnetting to port 80 and requesting the output of the PHP
program with a setcookie function) it was apparent that the Set-Cookie Header tag was being output
before the Content-type tag. For the web sites that were able to succesfully set a cookie in an
Explorer site, they always send the Set-Cookie tag after the Content-Type tag.
On looking through PHP's source code, it appears that any Content-Type commands are always
output last. That is they are queued as the last thing to be output. This is causing the PHP
setcookie function to fail when Internet Explorer browsers are being used.
We tried to overcome this by using the Header function to output a Content-Type tag before the
setcookie function was called. But this was not output immediately and queued for the end when the
entire header is flushed out. If this was possible to output the Content-Type header tag, then it
should solve the problem. Alternatively, the order of the header tags needs to be re-arranged so
that they are output correctly for IE to understand.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net