Re: Get out of corrupted session

[email protected] ("Christoph M. Becker")
Newsgroups php.general
Message-ID <[email protected]>
On 26.04.2017 at 16:13, Côme Chilliet wrote:

> When there is corrupted or invalid data in the session, it triggers a Fatal error when calling session_start.
> 
> My problem is the data is still in the session so there is no way to get out of this fatal error other than deleting the cookie by hand.
> I would like to destroy the session in case of fatal error, which seems a pretty reasonnable behavior.
> 
> Is there any way to do this ? I heard of register_shutdown_function but it seems to be called even when no errors occurs. Can the method called detect if it was called by a fatal error or not ?

Are you looking for set_error_handler
(<http://php.net/manual/en/function.set-error-handler.php>)?

-- 
Christoph M. Becker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.