|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-01 02:14 UTC] derick@php.net
[2004-04-12 14:27 UTC] alan dot warden at btinternet dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 13:00:01 2025 UTC |
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.