php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31401 corrupted $_SESSION variable
Submitted: 2005-01-04 06:44 UTC Modified: 2005-01-04 08:01 UTC
From: mleon at scientificinformatics dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.8 OS: Linux (Mandrake 10.0)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mleon at scientificinformatics dot com
New email:
PHP Version: OS:

 

 [2005-01-04 06:44 UTC] mleon at scientificinformatics dot com
Description:
------------
After using  $_SESSION['i'] as an argument to file_get_contents(), $_SESSION['i'] value is replaced by the file loaded with file_get_contents()

Reproduce code:
---------------
session_start();
$_SESSION['temppdf']="reports/processed/temp-33689592941d9fbfcca184.pdf";
echo "<br>SESSION['temppdf']: ".$_SESSION['temppdf'];
	$temppdf = file_get_contents($_SESSION['temppdf']);
echo "<br>SESSION['temppdf']: ".$_SESSION['temppdf'];	

Expected result:
----------------
SESSION['temppdf']: reports/processed/temp-33689592941d9fbfcca184.pdf
SESSION['temppdf']: reports/processed/temp-33689592941d9fbfcca184.pdf




Actual result:
--------------
SESSION['temppdf']: reports/processed/temp-33689592941d9fbfcca184.pdf
SESSION['temppdf']: %PDF-1.4 3 0 obj <> endobj 4 0 obj <> stream x??VM??0 ?ϯ?qZ?%[?...............

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-04 08:01 UTC] sniper@php.net
Set php.ini option "register_globals" to off.
You could also avoid this 'bug' by using some other variable name than $temppdf..

No bug here.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 14:00:03 2025 UTC