Title: Plugin causing Site Health Errors: An active PHP session was detected
Last modified: May 5, 2022

---

# Plugin causing Site Health Errors: An active PHP session was detected

 *  [olessol](https://wordpress.org/support/users/olessol/)
 * (@olessol)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/)
 * The plugin causes 1 critical issue:
    **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 had to disable the plugin.
 * Version 1.1.9

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Support [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * (@mkesteban08)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15621005)
 * Hi [@olessol](https://wordpress.org/support/users/olessol/) ,
 * It could be a conflict with another plugin or even with the theme. Could you 
   please try to re-activate the Premmerce plugin, and proceed in deactivating the
   other plugins on your site and see if the issue will persist.
 * Please feel free to let us know how it goes and I’ll be glad to further assist
   you with this.
 *  [sxmotive](https://wordpress.org/support/users/sxmotive/)
 * (@sxmotive)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15651783)
 * I have the same issue.
 * `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 disabled all plugins (except WooCommerce and Premmerce Wholesale Pricing for
   WooCommerce) and have changed theme to default. The error still here.
 *  [sxmotive](https://wordpress.org/support/users/sxmotive/)
 * (@sxmotive)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15651825)
 * I solve the issue. You need change
 * >  if ( !session_id() ) {
   >  session_start(); }
 * to
 * >  if ( !session_id() ) {
   >  session_start( [ ‘read_and_close’ => true, ] ); }
 * in admin.php
 *  Plugin Support [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * (@mkesteban08)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15651963)
 * Hi [@sxmotive](https://wordpress.org/support/users/sxmotive/) ,
 * Thank you very much for providing this solution 🙂
 * I’ll be sure to forward this to our developers.
 * Have a great day ahead!
 *  Thread Starter [olessol](https://wordpress.org/support/users/olessol/)
 * (@olessol)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15656464)
 * After change
 * if ( !session_id() ) {
    session_start(); }
 * to
 * if ( !session_id() ) {
    session_start( [ ‘read_and_close’ => true, ] ); }
 * in admin.php`
 * ERROR
 * Constant ‘read_and_close’ – assumed ‘‘read_and_close’’ (this will throw an Error
   in a future version of PHP) in public_html/wp-content/plugins/premmerce-woocommerce-
   wholesale-pricing/src/Admin/Admin.php on line 46
 * Warning: session_start(): Setting option ‘‘read_and_close’’ failed in
    public_html/
   wp-content/plugins/premmerce-woocommerce-wholesale-pricing/src/Admin/Admin.php
   on line 46
 *  Thread Starter [olessol](https://wordpress.org/support/users/olessol/)
 * (@olessol)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15656515)
 * May be
 *  if ( !session_id() ) {
    session_start([‘read_and_close’ => true]); }
 *  Plugin Support [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * (@mkesteban08)
 * [4 years ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15659649)
 * Hi [@olessol](https://wordpress.org/support/users/olessol/) ,
 * Our developers will be checking this and we’ll be sure to get back to you with
   the most viable solution on this.
 * Cheers,
 *  [radchuk2012](https://wordpress.org/support/users/radchuk2012/)
 * (@radchuk2012)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15840360)
 * Same problem – active PHP session was detected. PHP-FPM 8.1. WooCommerce: 6.7.0
 *  Plugin Support [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * (@mkesteban08)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15841710)
 * Hi [@radchuk2012](https://wordpress.org/support/users/radchuk2012/) ,
 * The team is still investigating this and actively working on not using the $_Session
   to handle messages.
 * I hope for your kind understanding regarding this. Have a nice day ahead!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Plugin causing Site Health Errors: An active PHP session was detected’
is closed to new replies.

 * ![](https://ps.w.org/premmerce-woocommerce-wholesale-pricing/assets/icon-256x256.
   png?rev=1840685)
 * [Premmerce Wholesale Pricing for WooCommerce](https://wordpress.org/plugins/premmerce-woocommerce-wholesale-pricing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/premmerce-woocommerce-wholesale-pricing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/premmerce-woocommerce-wholesale-pricing/)
 * [Active Topics](https://wordpress.org/support/plugin/premmerce-woocommerce-wholesale-pricing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/premmerce-woocommerce-wholesale-pricing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/premmerce-woocommerce-wholesale-pricing/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [Mark Kevin](https://wordpress.org/support/users/mkesteban08/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/plugin-causing-site-health-errors-an-active-php-session-was-detected/#post-15841710)
 * Status: not resolved