ID:               22440
 User updated by:  garfield_fr at tiscali dot fr
 Reported By:      garfield_fr at tiscali dot fr
-Status:           Feedback
+Status:           Open
 Bug Type:         CGI related
 Operating System: Windows 2000 pro SP3
 PHP Version:      4.3.2-dev
 New Comment:

I try using last CVS snapshot (30 mar 2003).
bug is still here !! setcookie() with header("location: ...") doesn't
work ...(test with phpnuke 6.0.17, in login page)


Previous Comments:
------------------------------------------------------------------------

[2003-03-30 06:46:26] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

This bug is likely fixed by a recent patch in CVS, so please try the
latest cvs snapshot again.


------------------------------------------------------------------------

[2003-02-27 08:54:17] [EMAIL PROTECTED]

reclassified


------------------------------------------------------------------------

[2003-02-27 07:59:59] garfield_fr at tiscali dot fr

I set cgi.rfc2616_headers = 1 ... and I have no change :(

and I can't modify my script because I do some tests to give PHP to
customers ...

------------------------------------------------------------------------

[2003-02-27 06:11:36] davidfelton at codemasters dot com

Have solved it:
I set cgi.rfc2616_headers in the php.ini to 1. I didn't know about this
new setting.

Thanks.

------------------------------------------------------------------------

[2003-02-27 05:53:41] davidfelton at codemasters dot com

I've been experiencing a very similar/the same bug with IIS on windows
2000 and setting cookies using PHP as CGI.

How I set my cookies is as follows:

As there is a bug in IIS that prevents you from setting cookies in
conjunction with Header("Location: ...") the filenames of the files
that set cookies are preceded with 'nph-' as detailed here:

http://support.microsoft.com/default.aspx?scid=KB;en-us;q176113

so that I can send my own headers. This worked fine in PHP 4.2.3, now
with PHP 4.3.2 It just doesn't work and headers are printed out to the
screen. Code used is as follows:

function MySetCookie($CkyName, $CkyValue, $exp, $pth, $domain,
$Secure)
                        {
                        $exp = gmstrftime("%A, %d-%b-%Y %H:%M:%S",$exp);
                        return "Set-Cookie: Territory=$CkyValue; path=$pth; 
domain=$domain;
expires=$exp";
                        }

            $territory="EnglishUK";

                //go to the main page
                Header("HTTP/1.0 302 Redirect");
                Header("Location:
http://www.mydomain.com/mainpage.php?territory=$territory";);
                //set cookie            
                
Header(MySetCookie("Territory",$territory,mktime(0,0,0,date("n"),date("j")+30),"/","mydomain.com",0));

(note this file needs to be saved as 'nph-index.php')

This is an issue with PHP and not ISS.

Thanks.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22440

-- 
Edit this bug report at http://bugs.php.net/?id=22440&edit=1

Reply via email to