From: ezdevelop at hotmail dot com
Operating system: win2000 adv server
PHP version: 5.0.0RC1
PHP Bug Type: Session related
Bug description: session_destroy doesn't work
Description:
------------
When I'm trying to use session_destroy() functioni n the __destruct()
function, PHP says:
"Warning: Trying to destroy uninitialized session"
I'v tested the code under Apache and IIS, but all the same mistake.
Reproduce code:
---------------
<?php
class test
{
function __construct() {
echo 'Initialize the session.';
session_start();
}
function __destruct() {
session_destroy();
echo 'Finally, destroy the session.';
}
}
$test = new test();
?>
Expected result:
----------------
Initialize the session.
Warning: session_destroy() [function.session-destroy]: Trying to destroy
uninitialized session in D:\wwwroot\sess.php on line 10
Finally, destroy the session.
--
Edit bug report at http://bugs.php.net/?id=27818&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27818&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27818&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27818&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27818&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27818&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27818&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27818&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27818&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27818&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27818&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27818&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27818&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27818&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27818&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27818&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27818&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27818&r=float