From: bill at rubgrp dot com Operating system: Linux (Fedora 11) PHP version: 5.2.9 PHP Bug Type: Session related Bug description: Transparent session ID occasionally not added
Description: ------------ Sometimes when adding a session ID to a URL, it is not added after existing parameters, but rather iafter the closing quote for the URL. For example, an anchor tag of '<a href="xyzzy.php?arg=y">' would be rewritten as '<a href="xyzzy.php?arg=y"?PHPSESSID=123...>' instead of '<a href="xyzzy.php?arg=y&PHPSESSID=123...">'. This appears to be similar to the issue reported in bug #3411. It appears to be buffer related, since adding or subtracting a few characters from earlier in the page can introduce or eliminate the error. As mentioned in #3411, turning on output buffering eliminates the problem. This seemed to work correctly through 5.2.5, but has not worked since 5.2.6. Reproduce code: --------------- Since it appears to be dependent on the number of bytes in the buffer, it can't be reproduced in 20 lines. Here is a link to a page that generated the examples: http://www.rubgrp.com/~bill/sample.php Expected result: ---------------- <a href="custmain.php?srch=000006&PHPSESSID=ho7ev8p2bmc16rotaih4duat82">000006</a> ...snip... <a href="custmain.php?srch=000007&PHPSESSID=ho7ev8p2bmc16rotaih4duat82>000007</a> ..snip... <a href="custmain.php?srch=000008&PHPSESSID=ho7ev8p2bmc16rotaih4duat82">000008</a></td> Actual result: -------------- <a href="custmain.php?srch=000006&PHPSESSID=ho7ev8p2bmc16rotaih4duat82">000006</a> ...snip... <a href="custmain.php?srch=000007"?PHPSESSID=ho7ev8p2bmc16rotaih4duat82>000007</a> ..snip... <a href="custmain.php?srch=000008&PHPSESSID=ho7ev8p2bmc16rotaih4duat82">000008</a></td> (The first and third are correct; in the second line the session ID is added after the closing quote on the href value.) -- Edit bug report at http://bugs.php.net/?id=48565&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48565&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48565&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48565&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48565&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48565&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48565&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48565&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48565&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48565&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48565&r=support Expected behavior: http://bugs.php.net/fix.php?id=48565&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48565&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48565&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48565&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48565&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48565&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48565&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48565&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48565&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48565&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48565&r=mysqlcfg
