Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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

    #1408156

    Hey 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,
    Rikard

    #1408397

    Thanks Rikard. Yes logged out on every page. I will try to run some further tests to determine if Enfold is impacting the plugin operation.

    #1408413

    Hi,

    Thanks for the update, we’ll keep this thread open for you.

    Best regards,
    Rikard

    #1427597

    Hello, 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

    #1427617

    Hi,

    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,
    Rikard

    #1427622

    Thanks 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.

    #1427624

    Hi,
    The only DocCheck plugin that I could find has beed closed on the WordPress library: doccheck-login
    Enfold_Support_4028.jpeg
    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,
    Mike

    #1427681

    Yes, 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.

    #1427689

    Hi,
    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,
    Mike

    #1427707

    Thank 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.

    #1427711

    Hi,
    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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘PHP Warning headers have already been sent’ is closed to new replies.