session_start should not be called during WP Cron
-
Error stack trace:
session_start(): Session cannot be started after headers have already been sent
in session_start called at /code/wp-content/plugins/favorites/app/Bootstrap.php (83)
in Favorites\Bootstrap::startSession called at /code/wp-content/plugins/favorites/app/Bootstrap.php (43)
at /code/wp-includes/class-wp-hook.php (324)
at /code/wp-includes/class-wp-hook.php (348)
called at /code/wp-includes/plugin.php (517)
do_action called at /code/wp-settings.php (727)
require_once called at /code/wp-config.php (228)
require_once called at /code/wp-load.php (50)
require_once called at /code/wp-cron.php (46)Can you please fix by adding:
/**
* Initialize a Session
*/
public function startSession()
{
// if cron job, do not start session
if ( defined( 'DOING_CRON' ) && DOING_CRON ) return;
if ( $this->settings_repo->saveType() !== 'session' ) return;
if ( !session_id() ) session_start();
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.