PHPSESSID appended completely wrong with session.use_trans_sid enabled

klaus triendl <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
Hi,

it seems to me that I've hit a bug related to the session.use_trans_sid
feature when output buffering (output_buffer) is on and configured to be
less than the content-size sent to the browser.

A self-made template system produces a php script as a string which gets
then eval'd. The produced script contains many 'echo' directives and
if-statements that evaluate conditions fed by the template system.

It is sometimes necessary to conditionally output parameters in an url
of a link (html anchor). So, instead of echo'ing the whole link at once
it gets written to the output with 'echo' 3 or more times.

E.g.
<code>
echo '<a href="editfilingcard.m-box?action=modify&amp;fcardid=3067';
// some condition from the template system was evaluated
// to be true
if (true)
  echo '&amp;belongs2fcard=1411';
echo '&amp;setmgrname=mboxobj">link text</a>
</code>


Now, it happens sometimes that the session ID is appended completely
wrong after the quote closing the 'href' attribute but before the
tag-closing '>':
<a
href="editfilingcard.m-box?action=modify&amp;fcardid=3067&amp;belongs2fcard=1411&amp;setmgrname=mboxobj"?PHPSESSID=f0hriua92m1oe6hmn47upm8n34>

Interestingly, links before or after the one mentioned here aren't
affected in my scenario.
Also, removing enough characters from the output before the link,
everything works fine; and if I increase the output buffer from the
default (4096) to 8192 (which is more than the content-size in my
scenario) everything is fine, too.


I assume, due to my tests, that output buffering somehow interferes
badly with automatically inserting the session ID.


I'm using php-5.2.10 on windows together with apache and IIS.
Any help is welcome, I can provide a script reproducing the problem.

Klaus

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.