#27818 [Sus->WFx]: session_destroy doesn't work

From: Date: Mon, 02 Jan 2006 08:05:56 +0000
Subject: #27818 [Sus->WFx]: session_destroy doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91341@lists.php.net to get a copy of this message
ID: 27818 Updated by: sniper@php.net 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] derick@php.net 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

« previous php.bugs (#91341) next »