Quote from thewebgecko on August 4, 2023, 17:51
Under 'Site Health' WordPress is showing critical error:
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.
After deactivating all plugins on the site, the WOOCS - WooCommerce Currency Switcher was the plugin activating this error message.
Online forums suggest changing this code:
if ( !session_id() ) {
session_start();
}
to this code:
if ( !session_id() ) {
session_start( [
'read_and_close' => true,
] );
}
Your code is written slightly different and when I attempted this fix, the plugin stopped switching currency. So I am submitting this ticket so you can update the plugin.
Thanks in advance.
Best,
Christine Levac
The Web Gecko
Under 'Site Health' WordPress is showing critical error:
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.
After deactivating all plugins on the site, the WOOCS - WooCommerce Currency Switcher was the plugin activating this error message.
Online forums suggest changing this code:
if ( !session_id() ) {
session_start();
}
to this code:
if ( !session_id() ) {
session_start( [
'read_and_close' => true,
] );
}
Your code is written slightly different and when I attempted this fix, the plugin stopped switching currency. So I am submitting this ticket so you can update the plugin.
Thanks in advance.
Best,
Christine Levac
The Web Gecko