PHP 4.0 Bug #2950: Insertion of extra text into output stream with session handling on/cookies off

From: Date: Fri, 10 Dec 1999 11:26:39 +0000
Subject: PHP 4.0 Bug #2950: Insertion of extra text into output stream with session handling on/cookies off
Groups: php.dev 
Request: Send a blank email to php-dev+get-13553@lists.php.net to get a copy of this message
From: colm@indigo.ie Operating system: Red Hat 5.2 PHP version: 4.0 Beta 3 PHP Bug Type: Scripting Engine problem Bug description: Insertion of extra text into output stream with session handling on/cookies off With session handling turned on in PHP4 (Beta3), eveything is going very well. When cookies are turned off on the browser, php cleverly inserts the sid onto the end of each HREF on a given page. Fine so far. However, I've come across the following situation when I need to use an anchor on the current page as my HREF. e.g. <A HREF="#joe">Go to Joe's paragraph</A> With cookies enabled, this works as expected, session handled fine. With cookies disabled, session handling still works, but the script is generating some spurious text in the midst of the HTML approx 3 lines down from the HREF: Go to Joe's paragraph Go to Bob's Paragraph Go to Sam's Paragraph &PHPSESSID=a07238db17f1ea7a6261ddb70d08cbc9"#joe">Go to Joe's paragraph Go to Bob's Paragraph Go to Sam's Paragraph That is exactly what appears in the browser (IE and NN) and the Page source reveals the same thing. Note that the HREF works fine, and session data is maintained, just this piece of extra text appears. The source php script is nothing more that the HREF statement above. I've tried echoing it using PHP, and just using straight HTML but the result is the same. So to reproduce: 1) Set up script as follows: ------------------------------- <?session_start()?> <HTML> <HEAD> <TITLE>Joe</TITLE> </HEAD> <BODY> <A HREF="#joe">Joe</A><BR> <A NAME="joe"> </A>Joe's Paragraph </BODY> </HTML> 2)Turn off cookies on browser: 3) Load script OUTPUT --------- <HTML> <HEAD> <TITLE>Joe</TITLE> </HEAD> <BODY> <A HREF="#joe">Joe</A><BR> <A NAME="joe"> </A>Joe's Paragraph </BODY> </HTML> ?PHPSESSID=0ca55f4ee15f1a1d045f73de8fda682f"#joe">Joe</A><BR> <A NAME="joe"> </A>Joe's Paragraph </BODY> </HTML> config info ------------ ./configure --with-apache=/apps/build/apache --with-mysql=/apps/mysql --with-msq l=/apps/msql --enable-sysvshm=yes --enable-trans-sid=yes --enable-sysvsem=yes -- enable-safe-mode=yes --enable-track-vars=yes --enable-magic-quotes=yes --enable- bcmath=yes

« previous php.dev (#13553) next »