An Active PHP Session was detected
-
Hi,
When i update the WordPress, site health showing the below message.
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.Below is my code
function.phpadd_action('init', 'start_session', 1); function start_session() { if(!session_id()) { session_start(); } }
and we user session variables across the different pages.
I tried below solutions.
1. Deactivating all plugins one by one, but it doesn’t solve the issue
2. session_start([‘read_and_close’ => true]);
– It clears the session error in site health. But the session variable is not set, session closed immediately when it starts.Kindly check, and give me the exact solution. Please.
Thank you.
The page I need help with: [log in to see the link]
- The topic ‘An Active PHP Session was detected’ is closed to new replies.