php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32568 session data is not available
Submitted: 2005-04-04 15:28 UTC Modified: 2005-04-12 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: duh at dowebwedo dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 5.0.4 OS: Debian stable
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-04-04 15:28 UTC] duh at dowebwedo dot com
Description:
------------
Session data stored in the session is not available when reloading the page again. This problem occured after upgrading from php 5.0.3 to 5.0.4; in 5.0.3 we do not experience this problem.

The last (append.inc) session listing in the first page request shows the session variables added to the session. One would expect these variables to show in the first (prepend.inc) session listing in the second page request. However, they do not show?

The same situation using php 5.0.3 returns the expected result, so it can safely be assumed that modifications made in php 5.0.3 to php 5.0.4 has introduced this session problem. 

Reproduce code:
---------------
Example source:
---------------
prepend.inc
<?php
  print_r($_SESSION);
  ...
  $db = new debugger();
  ...
?>

---application---

append.inc
<?php
  $db->show();
  ...
  print_r($_SESSION);
?>


Info:
-----
The application reads and writes to the session which means the session in the prepend can contain different values than in the append. Reading and Writing is done in classes (in this example: class debugger). 


Expected result:
----------------
Output first page request:
--------------------------
Array ( ) 
...
Array ( [DF_debug] => 1 [DF] => Array ( [debugger] => Array ( [debug_script] => [debug_php] => [debug_debugging] => [debug_queries] => [debug_get] => [debug_post] => [debug_cookie] => [debug_session] => ) ) ) 

Output second page request:
---------------------------
Array ( [DF_debug] => 1 [DF] => Array ( [debugger] => Array ( [debug_script] => [debug_php] => [debug_debugging] => [debug_queries] => [debug_get] => [debug_post] => [debug_cookie] => [debug_session] => ) ) ) 
...
Array ( [DF_debug] => 1 [DF] => Array ( [debugger] => Array ( [debug_script] => [debug_php] => [debug_debugging] => [debug_queries] => [debug_get] => [debug_post] => [debug_cookie] => [debug_session] => ) ) ) 



Actual result:
--------------
Output first page request:
--------------------------
Array ( ) 
...
Array ( [DF_debug] => 1 [DF] => Array ( [debugger] => Array ( [debug_script] => [debug_php] => [debug_debugging] => [debug_queries] => [debug_get] => [debug_post] => [debug_cookie] => [debug_session] => ) ) ) 

Output second page request:
---------------------------
Array ( [DF_debug] => 1 ) 
...
Array ( [DF_debug] => 1 [DF] => Array ( [debugger] => Array ( [debug_script] => [debug_php] => [debug_debugging] => [debug_queries] => [debug_get] => [debug_post] => [debug_cookie] => [debug_session] => ) ) ) 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-04 15:42 UTC] duh at dowebwedo dot com
In addition to my bugreport some additional information:

The session file appearantly does not contain the last session information that is shown through the print_r($_SESSION):
cat sess_9ces9k67hse393stv6dns4t964 
DF_debug|b:1;

At first I wanted to use the class destructor (__destruct(..) ) with my debugger but appearantly sessions are not available when destructing. Adding $db->show() to my append.inc instead solved that problem. Perhaps the behaviour of __destruct and append.inc are now based on the same rules?
 [2005-04-04 16:59 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-04-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-05-22 20:00 UTC] fabienf at gmail dot com
I experience the same issues as described. Running on Mac OS X 
10.4.1 (Tiger). Version 5.0.3 was fine, 5.0.4 introduced 
trouble; saved session files were empty. It happens when I put 
an object in the SESSION. Simple tests with scalars were fine.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Nov 27 15:05:53 2022 UTC