ID:               15983
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Session related
 Operating System: Debian/Linux mips platform
 PHP Version:      4.1.2 and 4.2.0
 New Comment:

I'm working with win version 4.1.2, and while the very first example's
code worked find for me (printed 'Hello world' as expected), the test
script from [EMAIL PROTECTED] did not.

>From my testing, it appears as though using $_SESSION just doesn't
register a value with the session, although it maintains any changes to
a variable once it has been registered with the session.

If instead of,

<?php

if(!isset($_SESSION['test'])) {
  $_SESSION['test'] = 0;
}
echo $_SESSION['test']++;

?>

you use,

<?php

if(!isset($_SESSION['test'])) {
 $test = 0;
 session_register('test');
}
echo $_SESSION['test']++;

?>

 the script will increment the variable just fine. But because
$_SESSION['test'] = 0; doesn't set/register the variable the first
time, each time you refresh you will find yourself stuck in the if
statement, and the value still stuck at 0.

 -- foos


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

[2002-04-30 13:47:37] [EMAIL PROTECTED]

This bug is killing me. Anyone tried 4.1.2 RC4 ?  Otherwise, I am
rolling back to 4.06. Don't really have time to do the workarounds....

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

[2002-04-28 07:31:44] [EMAIL PROTECTED]

Tried the latest snapshort and I have started to debug the code myself
using to computers a i386 as reference and the MIPS.

We will see how much I can debug of this.
Regards,

S�ren,

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

[2002-04-26 21:07:56] [EMAIL PROTECTED]

This _might_ be related to some fixes made recently..
Can you try with the latest CVS snapshot from http://snaps.php.net/
please?


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

[2002-04-25 17:30:54] [EMAIL PROTECTED]

Just compiled 4.2.0 tried the new script. The error is stille there.

The session file in /tmp contains:
test|i:1;

But it displays 0 (Which is correct the first time).

Change the filesystem from ext3 to ext2 to make sure that was not the
problem. Updated the system with updated packages from debian.

Regards,

S�ren,

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

[2002-04-24 18:19:03] [EMAIL PROTECTED]

Reopen if this script does not work for you with PHP 4.2.0:

<?php

session_start();
if(!isset($_SESSION['test'])) {
  $_SESSION['test'] = 0;
}
echo $_SESSION['test']++;

?>

It works fine here..(reloading the page increases the count)

--Jani


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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/15983

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

Reply via email to