From: olivier dot bichler at laposte dot net
Operating system: Windows XP
PHP version: 5CVS-2004-07-22 (dev)
PHP Bug Type: Session related
Bug description: Constant SID already defined with session_regenerate_id()
Description:
------------
session_regenerate_id() destroy the false constant : it destroy the
constant sid in lower case instead of the constant in upper case...
In PHP sources :
/* if the SID constant exists, destroy it. */
zend_hash_del(EG(zend_constants), "sid", sizeof("sid"));
should maybe be
/* if the SID constant exists, destroy it. */
zend_hash_del(EG(zend_constants), "SID", sizeof("SID"));
(file session.c)
(Please excuse me for my bad english ;-))
Reproduce code:
---------------
<?php
define('sid', 'essai');
session_start();
session_regenerate_id();
echo SID."\n";
echo sid;
?>
Expected result:
----------------
jg9vejq8p3e15lfu34vbouc6j3
essai
Actual result:
--------------
Notice: Constant SID already defined in D:\essai.php on line 5
Notice: Use of undefined constant sid - assumed 'sid' in D:\essai.php on
line 8
sid
--
Edit bug report at http://bugs.php.net/?id=29322&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29322&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29322&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29322&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29322&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29322&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29322&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29322&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29322&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29322&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29322&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29322&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29322&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29322&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29322&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29322&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29322&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29322&r=float