ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
924 stars 218 forks source link

An active PHP session was detected #4240

Open imhonson opened 2 years ago

imhonson commented 2 years ago

Wordpress keeps giving me this error: "An active PHP session was detected"

A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests."

I turned all my plugins off and on and it's Unyson that's causing the issue. However, if I disable it, it breaks my site. Can anyone help, how can I resolve this?

creative-belize commented 2 years ago

The issue is in hooks.php where session_start() is called twice. Simply replace session_start() with if (!isset($_SESSION)) { session_start(['read_and_close' => true]); }

and that will remove your critical site error.