A PHP session was created by a session_start() function đường dây nóng. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

asked Oct 15, 2020 at 17:42

1

In most cases, the real reason of the above errors is the incorrect mechanism for using PHP sessions within plugins or themes when they are using the session_start() function.

Now you need to tát identify what plugin cause this issue by deactive your plugin one by one.

Then in that plugin, you need to tát find a piece of code similar to tát this:

if ( !session_id() ) {
    session_start();
}

then change it to:

if ( !session_id() ) {
    session_start( [
        'read_and_close' => true,
    ] );
}

Then you are done. In most cases, this will fix the issue. Good luck!

answered Nov 24, 2020 at 4:26

2

Had the same issue due to tát WP Hotel Booking plugin use. I fixed it! Took u a while to tát find a plugin it caused and editing the plugin .php didn’t help. But I fixed it adding a snippet of code to tát functions.php of the CHILD theme:

function mymodule_curl_before_request($curlhandle){
session_write_close();
}
add_action( 'requests-curl.before_request','mymodule_curl_before_request', 9999 );

There's a background to tát this solution at: Make WordPress Vi xử lý Core, Loopback request fails if headers mix in curl (Original liên kết in German doesn't exist anymore and was referring to tát this other related discussion.)

answered Jan 19, 2021 at 22:39

4

Often this critical issue is caused by conflict in SESSION when using the PHP session_start() function. For example I have used a Calculation plugin in Wordpress and after Wordpress version update this error occured. So I detected the plugin which causes this issue as activated/deactivated plugins one by one.

SOLVING these errors: In File manager of my site I got the .php files of the plugin and searched for session_start() function. Where it was used after it I used this function in a row session_write_close();

Source of the function

Regards!

answered Jan 12, 2021 at 0:03

1

For those who narrowed it down to tát the Unyson plugin causing the error:

Open tệp tin manager and navigate to tát the theme the site is using. In the theme thư mục there is a 'functions.php' tệp tin. Add the following code to tát the file:

if (!function_exists('_disable_fw_use_sessions')) { add_filter('fw_use_sessions','_disable_fw_use_sessions'); function _disable_fw_use_sessions(){ return false; } }

Should look something lượt thích this when done.

Code added to tát functions.php

To chime in with my own experience here, this very issue was resolved by turning off the “cross sell pop up” module of Shopengine Pro. Indeed there’s a session start in the php. I have notified them about this today. Maybe it’ll help someone else meantime!

answered May 19, 2022 at 21:49

I found out that you get these critical health warnings when you install a plugin or a plugin Adon and fail to tát complete its setup to tát the kết thúc. So the simplest solution is to tát deactivate the plugin or complete the plugin set-up. My errors were caused by a Woocommerce Adon which I deactivated and when I refreshed the health status the two issues were gone. I hope this helps.

answered Sep 11, 2022 at 13:19

1

@David M., If the issue is specifically happening with the Cross-Sell Popup Module of the ShopEngine PRO plugin, then it can be fixed by adding a small piece of code on the cross-sell-popup.php tệp tin that will read and close the session of the Cross Sale Popup module immediately.

Big Thanks to tát @thống nguyễn for the solution.

On the line 18th, from where the session starts, replace the session_start() with the following code:

session_start([
    'read_and_close' => true
]);

Hope it will help.

answered May 21, 2022 at 7:35

If you tried the above and it's not working try to tát change the php version from your hosting's CPanel I had the same error ande i changed the php version from 7.4 to tát 7.3 and it all went well

answered Sep 16, 2022 at 18:11

2