From:             revealator at myrealbox dot com
Operating system: Windows98
PHP version:      4.3.4
PHP Bug Type:     Session related
Bug description:  session_start defect and not in sync with $_SESSION

Description:
------------
The constant SID is not defined if a session is started with
$_SESSION['bla'] = 'dummy'.

So you have to call session_start to get the SID constant.

But a call to session_start will kill a session that was already started
with $_SESSION['bla'] ='dummy'.

Reproduce code:
---------------
// register globals is off
error_reporting(E_NOTICE);
$_SESSION['dummy'] = 'started';
echo '<pre>';
echo "session data before call to session_start:\n";
print_r($_SESSION);

echo "SID is defined before call to session_start? "  . (defined('SID') ==
true?'yes':'no');
echo "\n";

session_start();
echo "SID is defined after call to session start? "  . (defined('SID') ==
true?'yes':'no');
echo "\n";

echo "session data after call to session_start:\n";
print_r($_SESSION);
exit;


Expected result:
----------------
SID should be defined when a session is started with $_SESSION and
session_start should handle the call to itself as if it was called twice
when $_SESSION is used.

Actual result:
--------------
session data before call to session_start:
Array
(
    [dummy] => started
)
SID is defined before call to session_start? no
SID is defined after call to session start? yes
session data after call to session_start:
Array
(
)



-- 
Edit bug report at http://bugs.php.net/?id=28080&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28080&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28080&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28080&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28080&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28080&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28080&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28080&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28080&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28080&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28080&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28080&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28080&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28080&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28080&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28080&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28080&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28080&r=float

Reply via email to