Bug #17186: session works only after reload on apache2, trans-sid didnt work

From: Date: Mon, 13 May 2002 17:31:39 +0000
Subject: Bug #17186: session works only after reload on apache2, trans-sid didnt work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7539@lists.php.net to get a copy of this message
From: joerg@php.net Operating system: IRIX64 6.5.15m PHP version: 4.2.0 PHP Bug Type: Session related Bug description: session works only after reload on apache2, trans-sid didnt work Testing the 4.2.1RC2 as a 64bit CGI with apache2 shows a strange behavior with a simple session script. Based on a example from the manual the following script only works after the page was reload. <?php //ini_set('session.use_cookies',0); session_start(); if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } ?> <html> <head><title>session test</title></head> <body> <?php echo 'count = '.$_SESSION['count'].'<br />'; echo '<a href='.$_SERVER['PHP_SELF'].'>link</a><br />'; ?> </body> </html> Nothing was shown during the first visit but client asking about for accepting the cookie, so after a reload page would work as aspectet. If the script sets 'session.use_cookies' to 0 the page wont works any more(no output). Same is happend when the same setup was made in the php.ini. Using the cgi via comandline the following output was given back.. Settings: 'session.use_cookies = 1' [o200]:/usr/local/apache/htdocs/php/sessions $ ../../../cgi-bin/php index.php X-Powered-By: PHP/4.2.1RC2 Set-Cookie: SID=8cdd40e358f292da280d84fbba73b6e3; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-type: text/html And now with the -q parameter [o200]:/usr/local/apache/htdocs/php/sessions $ ../../../cgi-bin/php -q index.php <br /> <b>Warning</b>: Cannot send session cookie - headers already sent in <b>/usr/local/httpd64/htdocs/php/sessions/index.php</b> on line <b>3</b><br /> [o200]:/usr/local/apache/htdocs/php/sessions $ and now with Settings: 'session.use_cookies = 0' the output looks similar to the first without the Set-Cookie information. Error_reporting is set to E_ALL and error.log is stil activate but shows nothing. when using the -q parameter no output was shown ?! ../../../cgi-bin/php -q index.php There is a testscript temporaray available under http://194.15.95.23:8080/php/sessions/index.php http://194.15.95.23:8080/php/sessions/index.phps //source http://194.15.95.23:8080/php/sessions/info.php // phpinfo() The same script runs fine with apache 1.3.24 + mod_php and cgi on http://194.15.95.23/php/sessions/index.php [o200]:/usr/local/apache/htdocs/php/sessions $ ../../../cgi-bin/php -m Running PHP 4.2.1RC2 Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies [PHP Modules] xslt xml wddx tokenizer sysvshm sysvsem standard shmop session posix pcre mysql ftp exif dio dbx dbase ctype calendar bcmath [Zend Modules] file ../../../cgi-bin/php ../../../cgi-bin/php: ELF 64-bit MSB mips-4 -- Edit bug report at http://bugs.php.net/?id=17186&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17186&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17186&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17186&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17186&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17186&r=support Expected behavior: http://bugs.php.net/fix.php?id=17186&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17186&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17186&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17186&r=globals

« previous php.bugs (#7539) next »