|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-26 10:13 UTC] garfield_fr at tiscali dot fr
I don't know if it's a real bug but .... Config : Windows 2K pro + SP3 Serveur IIS PHP 4.3.0 this is my php.ini (full version for testing purpose) : [PHP] cgi.force_redirect = 0 cgi.rfc2616_headers = 1 [Session] session.save_handler = files session.save_path = "C:\PHP\sessions\" I'm trying to use PHPNuke 6.0.17 and I found this bug : When you want to login under PHPNuke you enter your name/password. if your login is ok the script send a cookie and redirect to an URL (your personal page). With PHP in CGI mode, no cookie are send/receive (?) to the browser (IE6 SP1) and you are not connect to PHPNuke BUT if PHP run in ISAPI mode the cookie is well receive by browser and you are connected to PHPNuke.... I don't test under Apache because I don't know how to run PHP in CGI mode under Apache, but Apache+PHP module work fine (W2K) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
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.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)this is a little page to test the bug : if no cookie are set, click on "setCookie and header" link to set the cookie and redirect to other... cookie are not set !! tested with PHP Version : 4.3.2-RC Build Date : Mar 30 2003 09:11:32 <?php function SetTheCookie(){ setcookie("test","TestValue"); } function set_redir(){ SetTheCookie(); header("Location: ".$_SERVER['PHP_SELF']."?op=other"); } function delcookie(){ setcookie("test",""); } ?> <html> <head></head> <body> Test SetCookie function with Header("Location: ....") function...<br> <a href="<?= $PHP_SELF; ?>?op=set">just setCookie</a><br/> <a href="<?= $PHP_SELF; ?>?op=set_redir">setCookie and header("location:...")</a><br/> <a href="<?= $PHP_SELF; ?>?op=delcookie">delete cookie("location:...")</a><br/> <?php echo "\$_GET : <br><xm>";var_dump($_GET);echo "</xmp><br>"; $op = $_GET['op']; switch ($op){ case "set" : SetTheCookie(); break; case "set_redir" : set_redir(); break; case "delcookie" : delcookie(); break; } echo "\$_COOKIE : <br><xm>";var_dump($_COOKIE);echo "</xmp><br>"; ?> </body> </html>