• Resolved Fee

    (@wdfee)


    Hi there!

    WordPress sets a test cookie (wordpress_test_cookie) for every visitor to check if the browser accepts cookies. More cookies are only set if the user logs in or if a plugin or theme is used that set cookies for any other purposes.

    Many WordPress sites are used as pure CMS an do not offer a login/registration for visitors. The only person or few persons who need the login are the admin and site owner. If these sites do not use any cookie related plugin or theme, the wordpress_test_cookie is completely useless.

    With GDPR a cookie banner is needed for sites that set cookies. It’s annoying for site owners who do not provide any cookie based service or feature on their page that they cannot turn off this test cookie and have to mention a large cookie text on their privacy page or even include a banner.

    My suggestion is:
    Please set the test cookie only on login page, not on the complete frontend.

    What do you think about it?

    Thanks, Fee

Viewing 2 replies - 1 through 2 (of 2 total)
  • The functions to set and test the auth cookies are in pluggable.php. This means that they can be replaced easily by a plugin. Feel free to use one to get the results you want.

    Thread Starter Fee

    (@wdfee)

    Hi Joy, thanks for your answer, but I think there’s a kind of misunderstanding. I’ll try to be more precise:
    I do not want to set any cookie.
    I do not want to change the behaviour of authentication cookies.
    I want to be able to let visitors surf on my sites without any cookies for privacy reasons.

    I’ve now continued some debugging on different sites and found the issue.

    The ‘wordpress_test_cookie’ is not set in pluggable.php.
    In wp-includes/default-constants.php this cookie is defined as TEST_COOKIE constant. Via this constant the cookie is set in wp-login.php.
    WordPress itself sets this cookie only when visiting the login page – exactly what I want. Of course, the cookie is set on other pages, too, if a login form is included in frontend.
    Additionally this cookie is set by a security plugin I use, but it seems to be gone with an update of this plugin now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Request: set wordpress_test_cookie only on login screen’ is closed to new replies.