Why would I be seeing execution timeouts when setting $_SESSION values?

怎甘沉沦 提交于 2019-12-01 18:20:26

Sessions are blocking. session_start() will block execution until it can get an exclusive lock on that particular session's file. This is to prevent concurrency issues from cropping up. You can solve it by issuing a session_write_close() when you're done with the session in each script. The reason you're seeing it on the next line, is session_start() blocks for > than the max execution time. So when it returns, the next line is executed after the time limit, so that's where the error is raised.

See: session_write_close() for more information

Oh, and based on the errors you posted, the error is generated at the ob_start(); and the $_SESSION['nav'] = "range"; lines respectively, not the line 5 that you indicated in the code section...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!