-
AuthorPosts
-
May 21, 2023 at 10:35 am #1408052
I use a third party login plugin (DocCheck) to restrict access to certain pages on my site. I am getting these PHP warnings logged in error_log:
[21-May-2023 08:10:07 UTC] PHP Warning: session_start(): Session cannot be started after headers have already been sent in /home/mysitex/public_html/wp-content/plugins/doccheck-login/includes/class-dcl-base.php on line 304 [21-May-2023 08:10:13 UTC] PHP Warning: Cannot modify header information - headers already sent in /home/mysitex/public_html/wp-content/themes/enfold/includes/helper-privacy.php on line 406
I believe the impact of this is that the user must login on every page load rather than their login status being remembered. Is this something that can be fixed in an Enfold update or is this a plugin issue?
Thank you
May 22, 2023 at 3:29 pm #1408156Hey Rustybucket,
I’m not 100% sure, but I don’t think that those warning should impact any type of functionality on your site. Did you test if you are being logged out on every page?
Best regards,
RikardMay 24, 2023 at 11:00 am #1408397Thanks Rikard. Yes logged out on every page. I will try to run some further tests to determine if Enfold is impacting the plugin operation.
May 24, 2023 at 1:51 pm #1408413Hi,
Thanks for the update, we’ll keep this thread open for you.
Best regards,
RikardDecember 8, 2023 at 6:05 pm #1427597Hello, I have to revisit this issue. To remind you, the DocCheck plugin restricts access to certain pages. I am currently logged out on every page load.
[21-May-2023 08:10:13 UTC] PHP Warning: Cannot modify header information - headers already sent in /home/mysitex/public_html/wp-content/themes/enfold/includes/helper-privacy.php on line 406
As the line above suggests, this is related to Enfold cookie handling. If I disable cookie consent messages in Enfold then I can browse pages without having to login on every page load. When I enable cookie consent messages, the login status is not remembered and I have to login on every page page load. It does not make a difference if I accept of reject cookies.
My cookie consent setting is “User must accept and must opt in, only essential cookies selected”
This line:
[21-May-2023 08:10:07 UTC] PHP Warning: session_start(): Session cannot be started after headers have already been sent in /home/mysitex/public_html/wp-content/plugins/doccheck-login/includes/class-dcl-base.php on line 304
Relates to this code:
session_start( [ 'cookie_lifetime' => 86400, 'read_and_close' => true, // READ ACCESS FAST ] );
Any ideas how I can keep using cookie consent but avoid the headers related warning messages so DocCheck stays logged in?
Thank you very much
December 9, 2023 at 11:09 am #1427617Hi,
Thanks for the update. So these warnings will only appear when the the plugin in question is active? Maybe there is an alternative plugin which you could use? Also, which version of the theme are you running?
Best regards,
RikardDecember 9, 2023 at 11:37 am #1427622Thanks Rikard. Unfortunately this is the only plugin that performs this specific task so I can’t use a different one.
I’m using the latest version of the theme – updated yesterday.
December 9, 2023 at 12:40 pm #1427624Hi,
The only DocCheck plugin that I could find has beed closed on the WordPress library: doccheck-login
is this the one that you are referring to?
I assume that the plugin is tring to modify the headers to add it’s own login cookie and the plugin should call ob_start() at the top of the script to buffer the output.
Try contacting the plugin author to see if they are working on a solution for this, we are limited to the support that we can provide for third party plugins.Best regards,
MikeDecember 10, 2023 at 10:46 am #1427681Yes, unfortunately, that is the plugin I have to use.
They are already implementing ob_start() but I guess it is in the wrong way or wrong place. They do not answer support requests so I will just have to live with the issue for now.
Thanks again, appreciate your help.
December 10, 2023 at 12:27 pm #1427689Hi,
Ok, I would recommend finding another solution because it’s not often that WordPress takes down a plugin, I would be worry that it has malware in it.
Try searching on Upwork.com for plugin development, there are thousands of developers offering to create custom plugins that will do what you want, some even offer to customize existing plugins.
Unless there is anything else we can assist with on this issue, shall we close this thread then?Best regards,
MikeDecember 10, 2023 at 6:28 pm #1427707Thank you, that’s useful to know. It’s a client project so I will forward your suggestions and see what they want to do.
Yes, please close this thread.
December 10, 2023 at 6:35 pm #1427711Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘PHP Warning headers have already been sent’ is closed to new replies.