ID: 15310
Comment by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: Session related
Operating System: linux
PHP Version: 4.1.1
New Comment:

I mean value of $_SESSION['time'] lost at refresh.
When I comment line $test->t() script works correctly:

Array
(
    [time] => 1012549372
)

------------------new _SESSION:--------------------------

Array
(
    [time] => 1012549373
)

When I remove comment the output is like this (don't forget begin new
session):

Array
(
)

------------------new _SESSION:--------------------------

Array
(
    [time] => 1012549537
)


Previous Comments:
------------------------------------------------------------------------

[2002-02-01 02:22:49] [EMAIL PROTECTED]

What do you mean "it has not given result".

If you mean $time does not have value, it's normal.
if $_SESSION['time'] does not have value something wrong.
If you mean you don't see $test->$mT['TEST']['_SESSION_']['time'] does
not have value, it's your bug.

Please try to be more specific.



------------------------------------------------------------------------

[2002-01-31 06:06:48] [EMAIL PROTECTED]

I have removed session_register() call and began new session,  but it
has not given result.

------------------------------------------------------------------------

[2002-01-31 05:31:45] [EMAIL PROTECTED]

As I changed session manual recently,
NEVER use $_SESSION(or $HTTP_SESSION_VARS) AND
session_register/is_registered/unregister() functions.
(It's not only for 4.1.x but also for 4.0.x)

I warned it already. 

tracked vars and globals are handled inconsistent manner in session
module. 
I really would like to get rid of global var support from session
module for PHP5....

------------------------------------------------------------------------

[2002-01-31 04:50:23] [EMAIL PROTECTED]

Following code the shows strange bag.
When function t() called as object method, variable 'time' is not kept
in session.
Register_globals is On.

<?php
session_start();
class Test {
    var $mT = array();
    // this function does not deal with session
    function t()
    {
        reset($GLOBALS);
        while (list($k,$v)=each($GLOBALS))
            $GLOB[$k]=$v;
        $this->mT['TEST'] = $GLOB;
    }
}
$test = new Test;
$test->t(); // comment this line and script will work right
?>
<pre>
<?php
print_r($_SESSION);
$_SESSION['time'] = time();
session_register('time');
echo "\n-------new _SESSION:-----------\n\n";
print_r($_SESSION); echo "\n";
?>
</pre>

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=15310&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to