ID: 27818
Updated by: [EMAIL PROTECTED]
Reported By: ezdevelop at hotmail dot com
-Status: Suspended
+Status: Wont fix
Bug Type: Session related
Operating System: win2000 adv server
PHP Version: 5.0.0RC1
Previous Comments:
------------------------------------------------------------------------
[2004-04-12 14:27:59] alan dot warden at btinternet dot com
The behaviour is the same if the session is started when php start by
settin session.auto_start = 1
------------------------------------------------------------------------
[2004-04-01 02:14:15] [EMAIL PROTECTED]
This is actually expected behavior, as the session is already
automatically closed before destructors are run. There is some trickery
in the engine now that perhaps makes it possible to "fix" this, but
we'll suspend this for now.
------------------------------------------------------------------------
[2004-03-31 20:15:03] ezdevelop at hotmail dot com
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 this bug report at http://bugs.php.net/?id=27818&edit=1