php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14389 cookies problem
Submitted: 2001-12-09 05:00 UTC Modified: 2002-10-22 17:17 UTC
Votes:11
Avg. Score:4.5 ± 0.7
Reproduced:10 of 10 (100.0%)
Same Version:1 (10.0%)
Same OS:4 (40.0%)
From: demon at dreamers dot gr Assigned:
Status: Closed Package: IIS related
PHP Version: 4.1.1 OS: NT4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: demon at dreamers dot gr
New email:
PHP Version: OS:

 

 [2001-12-09 05:00 UTC] demon at dreamers dot gr
I'm using this code in 3 pages
in Page 1:
<form name="frm1" method="post">
<input type="password" size=20><input type="submit">
</form>

in page2:
if ($password == "mypassword") {
  setcookie("user", "admin");
  header("location: page3.php");
}

in page3:
echo $HTTP_COOKIE_VARS["user"];

i'm using NT4 with iis4. My problem is that the cookie is not set, instead of header("location: page3.php") i used this echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=page3.php\">"; and then i could get cookie value! this problem is only under iis4/iis5 under apache (not windows only unix) i didn't have any problems

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-08 02:56 UTC] lobbin@php.net
Do you still have this problem with PHP 4.1.1?
 [2002-01-08 05:24 UTC] demon at dreamers dot gr
yes i do
 [2002-01-08 05:44 UTC] demon at dreamers dot gr
yes i do
 [2002-04-22 11:52 UTC] ftouanen at yahoo dot fr
I'm using PHP 4.11 with Apache under NT 4 SP5.
I have exactly the same problem.

Note : When I use Apache + PHP 411 under WIN98, all working fine.
 [2002-04-26 14:35 UTC] fabio dot ottolini at edb dot ericsson dot se
I'm using PHP 4.2.0 with Apache 1.3.24 under NT 4 SP6.
I have exactly the same problem.
I have reported this bug a while ago and nothing happend.
 [2002-05-22 04:16 UTC] kiernicki at swipnet dot se
Same here, with IIS 5.0 under W2K.

Cant't use setcookie() and header() together.

Using echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=page3.php\">" instead of header() solves the problem.
 [2002-06-24 11:25 UTC] placebo_rulez at hotmail dot com
For me it, isn't working on:
Win2k SP2 - IIS 5.0 - PHP 4.1.0 and 4.2.1

and working fine under:
Win2k SP2 - Apache 1.3.24 - PHP 4.2.0 and 4.2.1

I was also using setcookie() and header() together. But kiernicki@swipnet.se slotution works fine.
 [2002-06-28 13:32 UTC] Gambti at CrazySnowBoarder dot com
php 4.2.1 on apache 2.0.39 on win2k server
 [2002-06-28 20:56 UTC] sniper@php.net
Try this snapshot:

http://snaps.php.net/win32/php4-win32-latest.zip

 [2002-07-01 23:47 UTC] tmokros at neo dot rr dot com
I'm having the same problem with php 4.2.1 in apache 2.0.36 on linux.

Using the following redhat rawhide packages:
php-4.2.1-6
httpd-2.0.36-6
 [2002-07-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-10-22 10:26 UTC] oliveremberton at hotmail dot com
I have the same issue for both Win & Linux platforms, following recent upgrades to 4.1.2. If I remove any header() statements I'm fine.

Bizarrely, only *some* clients seem affected on the Linux platform, with no obvious browser / OS pattern.
 [2002-10-22 12:55 UTC] rafaga_2k at hotmail dot com
i have the same problem in IIS 4.0 + Windows NT 4.0 build 1381 and my PHP version 4.2.3
 [2002-10-22 13:06 UTC] hholzgra@php.net
most browsers seem to ignore *any* header besides
Location: when they get a 3041/302/303/307 redirect status 

not a PHP problem
 [2002-10-22 15:27 UTC] rafaga_2k at hotmail dot com
i don't want to add a link to M$ but i'm detected that the problen in Windoze is in the IIS how you can view in their website, search for the bug Q176113 in M$ bug database and you can see the problem ,unfourten..lly  the problem can be resolved for ( IIS 3.0 ,4.0 ,5.0 )

maybe anyone can suggest any solve to this problem
 [2002-10-22 17:17 UTC] hholzgra@php.net
you are talking about 
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q176113&
and no, this is *not* the problem here

headers *are* sent at least with apache (verified using ethereal), but at least mozilla and netscape 4.x
ignore any headers beside Location as i already said
(can't check IE right know but i'm pretty sure it does
the same)

PS: thank you for *not* posting the MSDN URL; took
me only about 15min to find the reference to it as
a non-reqular MSDN user :(
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC