鸡生蛋,蛋生鸡。

六月 16th, 2012 Categories: 后端, 技术, 知识原野

解决PHP5.x生成Session的问题,纠缠数日。

Warning 

As of PHP 5.0.5 the write and close handlers are called after object destruction and therefore cannot use objects or throw exceptions. Exceptions are not able to be caught since will not be caught nor will any exception trace be displayed and the execution will just cease unexpectedly. The object destructors can however use sessions.

It is possible to call session_write_close() from the destructor to solve this chicken and egg problem but the most reliable way is to register the shutdown function as described above.

相关参考URL:123

Tags: , , , ,
尚无评论.

留言回复