session_start() causing massive slowdown?
-
I’ve noticed that on some sites, I’m getting a MASSIVE slowdown in the WordPress backend (very likely since our datacentre forced retirement of older verions of PHP). While writing a plugin for a new site, I saw it begin to happen shortly after starting to use session variables and tracked it down to the use of session_start().
Moving around the WP admin is all fine until I hit the products tab, then it takes about 5 minutes or so to load. Removing the session_start() reliably makes it all work fine.
Now, I’m “supposedly” starting my session properly using:
function register_my_session()
{
? if( !session_id() )
? {
? ? session_start();
? }
}
add_action(‘init’, ‘register_my_session’);Any idea what I might be doing wrong here? I’m sure this is somethng I’m not doing right somewhere.
Woocommerce ver: 7.4.1
Wooc0mmerce Blocks: ver 9.7.2
WordPress ver: 6.1.1
PHP ver: 7.3.33
(Minimal other plujgins on site at present)
- The topic ‘session_start() causing massive slowdown?’ is closed to new replies.