so I have following problem. I have a session class that should save it's data to database at the end of the request execution. Basically, when it is destructed. I'm using singleton pattern in this case. I have a destructor like this:
public function __destruct()
{
$this->_save(); // _save is public
// exit('I can reach this point with no error');
}
But with that code I get net::ERR_CONNECTION_RESET from chrome and other browsers. If I comment out the destructor and place this in constructor:
register_shutdown_function(array($this, '_save'));
The _save method is not returning any Exceptions when I call it directly.
Everything works fine. What could be wrong and why?
Thanks!