Skip to:

Cookie error after upgrading to WP 3.7.1 from 3.6.1

  • Profile photo of icepin



    Since yesterday I was using WP 3.6.1 and, ofc, BP 1.8.1. Decided to upgrade to WP 3.7.1 (had, still have few issues with BP Docs and decided to remove it). On development server and staging site everything was working fine (because i was login in from wp-login.php). Today I discovered that I can’t log in using a custom login form (like the one on the BP Default Theme’s sidebar).

    When I try to log in from the sidebar, redirects me to wp-login.php saying

    ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

    After many attempts to fix it I decided to create a fresh WP 3.7.1 install with a fresh database, downloaded BP 1.8.1, activated BP Default Theme and… bang, same error. (after, ofc, deleting browser’s cache/cookies, even trying on another PC)

    Any idea why is this happening and how to fix it?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of crazycoolcam


    Can you log in after one or two failed attempts using the default form: wp-login.php?

    If so, I presented a workaround on the WP forums, which I will share here:

    Add the following php code to your functions.php file, your bp-custom.php file, OR a mu-plugin file that you create:

    //fix for cookie error while login.
    function set_wp_test_cookie() {
    	setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
    		setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
    add_action( 'after_setup_theme', 'set_wp_test_cookie', 101 );

    This will try to set the test cookie anytime someone visits your site, and it will allow the sidebar form to start working again if wp-login.php and cookies are enabled.

    If you cannot sign in at all (after two or three attempts with wp-login.php), I have not seen a solution yet, but I have seen several threads about people with this issue after the upgrade to 3.7.1.

    Hope this helps, and I hope you are in the first category.

    Profile photo of icepin


    Hello Cam,
    Thanks for your reply, but unfortunately, didn’t worked.
    From wp-login.php I can log in from the first try.
    The scenario is like this:
    I have the login form with the exact code from bp-default’s theme sidebar on my index page, I type the user and PW there, press Login, redirects me to wp-login.php, press again it will log me in. Same scenario on a fresh WP + BP install with BP-Default Theme.

    If I try to log in using directly wp-login.php, I can log in with no problem. But when I try using a login form like the bp-default’s theme:

    <form name="login-form" id="" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
    		<input type="text" name="log" id="" class="input" placeholder="Email sau nume utilizator" value="<?php if ( isset( $user_login) ) echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" />
    	<br />
    		<input type="password" name="pwd" id="" placeholder="Parola" class="input" value="" tabindex="98" />
    	<br />
    		<label class="parola"><?php do_action( 'bp_sidebar_login_form' ) ?>
    		<input type="submit" name="wp-submit" id="" value="<?php _e( 'Simply, be awesome!', 'buddypress' ); ?>" tabindex="100" />
    		<label class="parola">Ai uitat parola?</label>
    		<input type="hidden" name="testcookie" value="1" />

    I get cookie error.

    Profile photo of icepin


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cookie error after upgrading to WP 3.7.1 from 3.6.1’ is closed to new replies.