Im getting an error in my wp-debug log saying "PHP Warning: session_start(): Cannot start session when headers already sent in ...hooks.php on line 228". Here is a code snippet from the file
function _action_fw_flash_message_backend_prepare() {
if ( ! session_id() ) {
session_start();
}
}
session_start(); is on 228. I have read that session_start should be the first line of code to be executed in the file. Will this not affect the functionality of the code? (I have zero PHP experience)
Move the session_start()
to top of the page. and ob_flush();
in footer or end of the script.
<?php
@ob_start();
session_start();
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With