{"id":19025190,"date":"2026-09-21T10:27:22","date_gmt":"2026-09-21T10:27:22","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/please-fix-php-session-never-closed\/"},"modified":"2026-09-21T10:27:22","modified_gmt":"2026-09-21T10:27:22","slug":"please-fix-php-session-never-closed","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/please-fix-php-session-never-closed\/","title":{"rendered":"Please fix: PHP session never closed"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello team,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">as mentioned by olessol half a year ago (<a href=\"https:\/\/wordpress.org\/support\/topic\/an-active-php-session-was-detected-34\/\">https:\/\/wordpress.org\/support\/topic\/an-active-php-session-was-detected-34\/<\/a>), there is an issue with an opened PHP session that is never closed. He even proposed a fix. You marked the entry as solved, but didn&#8217;t ship a fix 3 months ago with the latest version.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Leaving a PHP session open can adversely affect REST API and loopback calls due to session file lock. Please add <code>session_write_close()<\/code> to your code to close the session at an appropriate time, or use olessol&#8217;s suggestion <code>session_start(['read_and_close' =&gt; true])<\/code> if this doesn&#8217;t break your code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kind regards,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Florian<\/p>\n","protected":false},"template":"","class_list":["post-19025190","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19025190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19025190\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19025190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}