#18708 [Opn->Bgs]: Header("Location:") doesn't work after setCookie()?

From: Date: Fri, 02 Aug 2002 15:33:28 +0000
Subject: #18708 [Opn->Bgs]: Header("Location:") doesn't work after setCookie()?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15841@lists.php.net to get a copy of this message
 ID:               18708
 Updated by:       hholzgra@php.net
 Reported By:      andywright28@hotmail.com
-Status:           Open
+Status:           Bogus
 Bug Type:         HTTP related
 Operating System: Win2000 sp6a
 PHP Version:      4.2.2
 New Comment:

this is not a PHP issue, it is either the webserver or the browser that
ignores the SetCookie header on HTTP redirects

btw: your Location: header usage is dangerous, the RFC
clearly says that you have to use *absolute* URLs
in Location: headers


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

[2002-08-02 10:57:38] andywright28@hotmail.com

<?
//some processing
$info = base64encode("$information");
setcookie("user",$info,time()+15552000);
Header("Location: file.php");
?>

The cookie doesn't get set if a Header() function is used straight
after it. If I comment out the header function then the cookie is set
ok. I can also replace the Header() function with an echo() as in:
echo "<meta http-equiv='refresh' content='0;file.php'>";
and this works fine also.

The PHP installed is the 4.2.2 precompiled binary for Windows, running
php.exe from IIS version 5. The piece of code is actually used in
PHPNuke. Line 502 of /modules/Your_Account/index.php.

Am I missing something?

Andy

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


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



Thread (6 messages)

« previous php.bugs (#15841) next »