#18708 [NEW]: Header("Location:") doesn't work after setCookie()?

From: Date: Fri, 02 Aug 2002 14:57:39 +0000
Subject: #18708 [NEW]: Header("Location:") doesn't work after setCookie()?
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15832@lists.php.net to get a copy of this message
From: andywright28@hotmail.com Operating system: Win2000 sp6a PHP version: 4.2.2 PHP Bug Type: HTTP related Bug description: Header("Location:") doesn't work after setCookie()? <? //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 bug report at http://bugs.php.net/?id=18708&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18708&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18708&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18708&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18708&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18708&r=support Expected behavior: http://bugs.php.net/fix.php?id=18708&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18708&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18708&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18708&r=globals

« previous php.bugs (#15832) next »