|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-02 10:57 UTC] andywright28 at hotmail dot 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 19:00:01 2025 UTC |
I have the same problem except this is an BAD issue for me because my code looks like this: <? session_name("woot"); session_start(); if (isset($_SESSION["access"])) echo "Session was registered with: " . $_SESSION["access"]; else { $access = "session variable"; $_SESSION["access"]=$access; } header("Location: test2.php"); ?> Now obviously if the cookie does not get sent, then I cannot send the session id. I'm trying to migrate an application to IIS and this borks the entire site. I suppose I can get away with replacing all my header redirects with echo "<meta http-equiv='refresh' content='0;test2.php'>"; but I wish there was some way that was better than that.