ThemeFuse / Unyson

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

Critical Issue: an active PHP session was detected | (caused by Unyson) #4032

Open nextfilmz opened 4 years ago

nextfilmz commented 4 years ago

This critical issue was displayed in the Site Health Status on wordpress:

"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."

When I deactivate Unyson, the issue goes away.

How do I fix this? I would appreciate any help.

Thank you

NasimNet commented 4 years ago

You can temporarily remove the error by adding the following code to your theme

function disable_fw_use_sessions() {
    return false;
}
add_filter( 'fw_use_sessions', 'disable_fw_use_sessions' );
CarlosSLoureiro commented 4 years ago

@NasimNet This i'll cause the flash messages to not be printed. at "/framework/helpers/class-fw-flash-messages.php" - line 116

Apparently it was added to fix another issue: #2219

NasimNet commented 4 years ago

@CarlosSLoureiro Yes, This is only a temporary method Of course, I do not think the messages are too important

Kursymru commented 4 years ago

Dear all,

I am facing the same issue too, I brought a theme which required Unyson. When Unyson plugin is activated the website blocked on the preloader. Any idea how to fix this, please?

Thanks Kursy

ojosazules4228 commented 4 years ago

Same problem here! Any tip on how to fix it?

Thanks!

otakuyose commented 4 years ago

The problem is not only because of the message, it turns out that when I deactivate the unyson plugin my page loads much faster, before this problem appeared, my page was loading fast, then everything is too slow

Error:

An active PHP session was detected ::Rendimiento:: 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.

Cause: [27-Aug-2020 02:44:06 UTC] PHP Notice: Trying to access array offset on value of type null in /home1/sugoicom/public_html/wp-content/plugins/unyson/framework/helpers/class-fw-resize.php on line 35

corzel commented 3 years ago

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php


229: session_start();
230: }
231: session_write_close();
232: }
nildopio commented 3 years ago

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();
230: }
231: session_write_close();
232: }

Hi... can you explain this solution?

mcworks commented 3 years ago

I fixed it adding: session_write_close(); in lines 231 and 262 in this file: wp-content/plugins/unyson/framework/includes/hooks.php

229: session_start();
230: }
231: session_write_close();
232: }

Thanks this sorted me out...