Bug #52649 [NEW]: Wrong values are written into the session

From: Date: Fri, 20 Aug 2010 03:59:32 +0000
Subject: Bug #52649 [NEW]: Wrong values are written into the session
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153625@lists.php.net to get a copy of this message
From:             
Operating system: Windows 7 x64
PHP version:      5.3SVN-2010-08-20 (snap)
Package:          Session related
Bug Type:         Bug
Bug description:Wrong values are written into the session

Description:
------------
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'    => 'myNut.id'),
                                                                           
                      array('name'      => 'name',
                                                                           
                            'default'   => 'test',
                                                                           
                            'object'    => 'myNut2.name')),

                                                                           
    '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:
--------------
blazeCMS\view\IndexView

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52649&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52649&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52649&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52649&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52649&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52649&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52649&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52649&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52649&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52649&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52649&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52649&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52649&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52649&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52649&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52649&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52649&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52649&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52649&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52649&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52649&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52649&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#153625) next »