• Resolved atg2020wp

    (@atg2020wp)


    When we enable Page Caching and run our automated software over Google Chrome our WordPress login page provides us with an error message stating: “Error: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” As soon as we turn off page caching it works again without any problems.

    There has been no change to our cookie settings from one scenario to the other and any changes to the cookie setting in our Chrome browser, does not make any difference. The same problem persists.

    It seems that through manual intervention of refreshing the page temporarily resolves the issue, allowing us to resume our operations. However, this solution is not sustainable for production use. Please advise.

    Thanks, Stephan

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • wpmansour

    (@wpmansour)

    It sounds like when you enable page caching with WP-Optimize, you’re getting an error on your WordPress login page about cookies being blocked. WP-Optimize usually doesn’t cache pages for logged-in users, but let’s double-check. Go to the WP-Optimize settings again and make sure the option “Do not cache pages for logged-in users” is enabled. This should prevent any caching issues for admin tasks.

    Do you have any other caching or cookie-related plugins active? Sometimes these can conflict with WP-Optimize. If so, try deactivating them one by one to see if the issue goes away.

      Thread Starter atg2020wp

      (@atg2020wp)

      Hi, thank you for getting back to me. Both the option and the cookie related plugin checks out. Hence, the problem still persist. Please Advise. Thanks

      • This reply was modified 9 months ago by atg2020wp.
      wpmansour

      (@wpmansour)

      Alright, let’s try some steps you can take to resolve this:

      1) Exclude Login Page from Caching – Ensure the WordPress login page is excluded from being cached:

      1. Navigate to WP-Optimize -> Cache -> Advanced settings.
      2. Add /wp-login.php to the “URLs to exclude from cache” field.
      3. Save the changes and clear the cache.

      2) Check for Plugin Conflicts – Sometimes, other plugins can cause conflicts. To test this:

      1. Temporarily deactivate any other caching or security plugins.
      2. To do this, connect to your site via FTP or File Manager, navigate to /wp-content/plugins/, and rename the plugin folders (e.g., wp-optimize to wp-optimize-temp).
      3. Try logging in again to see if the issue is resolved.

      3) Modify wp-config.php – Adding a specific configuration to your wp-config.php file can help ensure cookies are set correctly:

      1. Access your site’s root directory using FTP or File Manager.
      2. Open wp-config.php and add the following code before the line /* That's all, stop editing! Happy blogging. */:phpCopy codedefine('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
      3. Save the file and try logging in again.

      4) Modify functions.php – If the issue persists, try modifying your theme’s functions.php file:

      1. Go to Appearance -> Theme Editor -> Theme Functions (functions.php).
      2. Add the following code at the end of the file:phpCopy codesetcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); if (SITECOOKIEPATH != COOKIEPATH) { setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); }
      3. Save the changes and check if you can log in.

      5) Clear Browser Cookies – Sometimes, cookies stored in your browser can cause conflicts:

      1. Clear your browser cookies and cache.
      2. Try logging in again.

      By following these steps, you should be able to resolve the caching and login issues. Let me know how it goes.

      Thread Starter atg2020wp

      (@atg2020wp)

      The first option worked. Thank you for your assistance.

    Viewing 4 replies - 1 through 4 (of 4 total)
    • The topic ‘Page cache prevents automatic admin login’ is closed to new replies.