Exception Thrown Without a Stack Frame and Sessions

Just a note, if anyone receives this error at the bottom of the page when programming in PHP, and you’ve checked things like throwing exceptions inside of exception handlers, check any objects you’re storing in $_SESSION. If an exception is thrown when the session mechanism serializes your objects (usually at the very end of a request), it will be outside of the regular code flow and will spit out an error at the very end of your output.

So, if this applies to you, make sure you do not attempt to serialize properties that cannot be serialized, using __sleep to limit the properties. Then, define a __wakeup to reconstruct those properties if necessary.

Ref: http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep

This entry was posted in PHP. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>