php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8686 Starting a session corrupts reading of external files.
Submitted: 2001-01-12 16:56 UTC Modified: 2001-01-20 03:03 UTC
From: derek at friendlysoftware dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: Linux AES.MandrakeSoft.com 2.2.1
Private report: No CVE-ID: None
 [2001-01-12 16:56 UTC] derek at friendlysoftware dot com
When I begin a session, using "session_start()" and then read in a file using file(), readfile(), or require(), the contents of the file get corrupted with double quote characters.

Here's a sample file to read in (name it "test_file.txt"):
<a.b=[]

Here's a PHP webpage that displays corrupted output:
<?php

session_start();
readfile( 'test_file.txt' );

?>

The corrupted output is:
<a.b="[]"

If the call to session_start() is removed from the above script, the output matches the sample file contents.

Also if any of the characters are removed from the sample file, the readfile() works fine, so there's something specific to the text in the sample file that disagrees with session_start().

FYI, the sample file is small section of javascript in an HTML file I am using.  I pared down the javascript/HTML to this small section that was getting corrupted.  I'm trying to echo different HTML files depending on session variables I set. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-19 20:22 UTC] cynic@php.net
duplicate of #8311
 [2001-01-20 03:03 UTC] sas@php.net
Please upgrade to PHP 4.0.4 or later. If you are not using the transparent session id propagation feature, please reopen this report.  I cannot reproduce the failure with the latest CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC