#37080 [NEW]: Cannot send session cookie - Cannot modify header information

From: Date: Fri, 14 Apr 2006 09:13:00 +0000
Subject: #37080 [NEW]: Cannot send session cookie - Cannot modify header information
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95777@lists.php.net to get a copy of this message
From: hodukibi at yahoo dot com Operating system: Linux PHP version: 4.4.2 PHP Bug Type: Session related Bug description: Cannot send session cookie - Cannot modify header information Description: ------------ I just test file login.php but when I submit it show errors session_start(): Cannot send session cookie and cannot modify header information - headers already sent by ... I don't use echo or print anything before Reproduce code: --------------- <body> <? $login = $_POST["login"]; if ($login==1) { session_start(); $admin = "abc"; session_register("admin"); header("Location: admin.php"); } ?> <form name="frmLogWP_User" method="post" action="login.php"> <input type="submit"> <input type=hidden name="login" value="1"> </form> </body> Expected result: ---------------- Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 11 Warning: Cannot modify header information - headers already sent by (output started at /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php:8) in /home2/glass/avsstouristservices-www/tiepthivn/wcms/aaa.php on line 14 -- Edit bug report at http://bugs.php.net/?id=37080&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37080&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37080&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37080&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37080&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37080&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37080&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37080&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37080&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37080&r=support Expected behavior: http://bugs.php.net/fix.php?id=37080&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37080&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37080&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37080&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37080&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37080&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37080&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37080&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37080&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37080&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37080&r=mysqlcfg

« previous php.bugs (#95777) next »