|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52649 Wrong values are written into the session
Submitted: 2010-08-20 05:59 UTC Modified: 2010-08-20 21:01 UTC
From: blue-tidus159 at hotmail dot com Assigned:
Status: Closed Package: Session related
PHP Version: 5.3SVN-2010-08-20 (snap) OS: Windows 7 x64
Private report: No CVE-ID: None
 [2010-08-20 05:59 UTC] blue-tidus159 at hotmail dot com
Well the problem is that I echo out the value of a session entry at the last line of code and the right value is echoed, but when I look into the file/db(custom session handler) the value is wrong.

I use Xampp 1.7.3/PHP 5.3.1 and I already tested every little part of the code. I found out that when I comment out an array that the value is saved right. I can't offer a whole test because this problem seems to appear only in this special context. I think that there somewhere gets memory overwritten or so, otherwise I can't explain that to myself. The array looks like that:
$this->conf = array('' => array('' => array('' => ''))
                    // a lot more lines like that
                    'navigation' => array( '/admin/*' => array('view' => 'blazeCMS\\view\\admin\\AdminView',
                                                                                'bind' => array(  array('name'      => 'id',
                                                                                                        'default'   => '0',
                                                                                                        'object'    => ''),
                                                                                                  array('name'      => 'name',
                                                                                                        'default'   => 'test',
                                                                                                        'object'    => '')),

                                                                                'action' => array(array('action'    => 'toLogin',
                                                                                                        'view'      => 'blazeCMS\\view\\admin\\LoginView'),
                                                                                                  array('action'    => 'success',
                                                                                                        'view'      => 'blazeCMS\\view\\admin\\AdminView')))

//                                                               '/*' =>     array('view' => 'blazeCMS\\view\\IndexView',
//                                                                                'action' => array(array('action'    => 'navigate',
//                                                                                                        'view'      => 'blazeCMS\\view\\IndexView'),
//                                                                                                  array('action'    => 'success',
//                                                                                                        'view'      => 'blazeCMS\\view\\IndexView')))

When I remove the comments then the problem appears, otherwise not. Any ideas?

Test script:
...// a lot of code
$_SESSION['my.view_id'] = $context->getView()->getViewId();
echo $_SESSION['my.view_id']; // returns the right value

Expected result:
.... Look into the session file ....

the value should be the view id which was assigned before.
In this case: blazeCMS\view\admin\AdminView

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-20 07:20 UTC]
-Status: Open +Status: Feedback
 [2010-08-20 07:20 UTC]
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 the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Given that sessions are obviously working in general for you, I'd be extremely surprised if this was actually a bug in PHP, but if you can provide a small, self-contained reproduction script that demonstrates the problem, that would certainly help, since there's no way to reproduce the issue given what you've posted.
 [2010-08-20 21:01 UTC] blue-tidus159 at hotmail dot com
-Status: Feedback +Status: Closed
 [2010-08-20 21:01 UTC] blue-tidus159 at hotmail dot com
Everything fine now, multiple other request changed values in the session because the other requests were handeled wrong.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 22:05:54 2022 UTC