Re: What can cause session_destroy to fail?

From: Date: Tue, 12 Jun 2007 15:28:49 +0000
Subject: Re: What can cause session_destroy to fail?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-256720@lists.php.net to get a copy of this message
Jim Lucas wrote: > Mattias Thorslund wrote: >> Jim Lucas wrote: >>> Mattias Thorslund wrote: >>>> Hi, >>>> >>>> One of my clients just received a PHP warning that session_destroy() >>>> failed. Using the default session handler (with tmp files), what >>>> are the >>>> most likely things that can cause session_destroy() to return false? >>>> >>>> Thanks for any suggestions. >>>> >>>> Mattias >>>> >>> The session was never initiated on that page with session_start() ?? >>> >>> on this page >>> >>> http://us.php.net/manual/en/function.session-destroy.php!GÝ >>> ðz®�t×ü6Õìˆ >>> >>> the first couple comments talk about different ways that the >>> session_destroy() function call mail fail? Any sound close? >> >> I read that too, but (as I read it) it talks about what the function >> does, and what you must do to to kill the session properly. But I can't >> see what might actually cause the function to return false. >> >> Mattias >> > > maybe the fact that the session was never started in the first place > > first off, define "failed". Does it give a fatal error, return false, > etc... ?? Returns false, as I mentioned twice above. Also returns a PHP warning. I got some more info now. The error message they get is "session_destroy(): Session object destruction failed". On my test page, with simply a session_destroy() before any session_start(), the error (warning) message is "Trying to destroy uninitialized session". This happens both on PHP 4.4.4 and 5.2.1. So, these are different... Mattias

« previous php.general (#256720) next »