php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2950 Insertion of extra text into output stream with session handling on/cookies off
Submitted: 1999-12-10 06:26 UTC Modified: 2000-07-18 09:29 UTC
From: colm at indigo dot ie Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Beta 3 OS: Red Hat 5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: colm at indigo dot ie
New email:
PHP Version: OS:

 

 [1999-12-10 06:26 UTC] colm at indigo dot ie
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-18 09:29 UTC] hholzgra at cvs dot php dot net
rewriting of 'empty' urls has been fixed in cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 20:01:35 2024 UTC