php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28475 Variable dropping value with Sessions and PEAR::Log
Submitted: 2004-05-21 19:09 UTC Modified: 2005-09-02 08:48 UTC
From: m at saffitz dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0RC3 OS:
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: m at saffitz dot com
New email:
PHP Version: OS:

 

 [2004-05-21 19:09 UTC] m at saffitz dot com
Description:
------------
I have a simple session handler which uses a postgres 
database for storage, and Pear::Log for logging.  A 
script with all necessary code for reproduction is 
below.

When I run the code as is (obviously adding in db 
parameters), the code runs without errors, but the path 
to the log is inserted as the id in the database instead 
of the session id.

There are two independent changes I can make to avoid 
this behavior:
1) Use a shorter path for the log file.  Using /log.log 
and the script functions as expected.
2) Switch lines 52 and 53, and 56 and 57, (i.e. to:
 $sql = "insert into sessions (id,datavalue) values 
('$id','$val')";
 $this->logger->log("Not found, inserting");
 With the lines switched the script functions as 
expected.

I've seen this bug on Mac OS X and Fedora Core 1.

Reproduce code:
---------------
http://www.saffitz.com/phperr.phps

Session Table Definition:

Table "public.sessions"
      Column       | Type | Modifiers 
-------------------+------+----------------------
 id                | character varying(255)  | not null
 created_date      | date                    | not null default '2004-05-15'::date
 modification_date | timestamp without time zone | not null default '2004-05-15 00:35:58.094778'::timestamp without time zone
 datavalue         | text                    |
 
Indexes: sessions_pkey primary key btree (id)

Expected result:
----------------
Session is populated correctly in the database (with 
correct id), and the count printed to the screen 
increments with each refresh.

Actual result:
--------------
Session is incorrectly populated in the database (path 
to log file is populated instead), and the count on the 
screen is not incremented.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-02 08:48 UTC] sniper@php.net
PEAR bugs belong to pear.php.net
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC