WordPress 3.8 gives me “You must enable cookies to use WordPress.” at login

I have recently updated my wordpress to 3.8. Since then I appear to not be able to login to WordPress.

I get the error message “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” thing is cookies are working fine. They ARE enabled. I’ve cleared them tried different browser everything. I think it might be something in the WP settings.

Read More

I have tried the fix for commenting out the cookie check in the wp-login.php

I would appreciate any help getting my wordpress site working again.

Related posts

Leave a Reply

6 comments

  1. Try to add below code in your theme’s function.php

                //fix for cookie error while login.
                setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
                if ( SITECOOKIEPATH != COOKIEPATH )
                    setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
    

    One more option which worked for me, I developed my client’s on my server and it’s URL is “www.mydomain/clients/clientname” when i deployed it to client’s server on main domain i was getting this cookie issue in WordPress backend, tried almost every solution available online but this one worked for me.
    Go to wordpress database and check “wp_options” option table and change url to you domain URL Woila! worked for me.

    See if this can help someone.

  2. I think you have just cleared your cookies and then trying to login to your site. If you are doing such then I suggest, you have to refresh your browser’s tab after doing clear cache cookies and then login. Hope it may help you out. Thanks.

  3. I managed to fix the problem although I am not 100% sure what caused it.

    Firstly I changed the name of the plugins folder. This allowed me to atleast login.

    I then renamed the folder back to plugins. This will now show all the plugins again, however they will now be deactivated.

    I went through each plugin login out each time to see if I could login. When I found the plugin I deleted it. I then reinstalled it and tested the login / logout. It works fine now.

    Happy but bemused at why it failed in the first place.

    I hope this help someone else. The plugin causing the apparent problem seemed to be Youtube Channel Gallery

    Cheers.

  4. I have faced the same problem.

    The problem is with version update of wordpress in my case and reset the password using http://codex.wordpress.org/Resetting_Your_Password after I added

    error_reporting(E_ALL);
    ini_set(‘display_errors’, 1);

    after I see the problem is
    Warning: Cannot modify header information – headers already sent by (output started at /zz/zzz/file.php)

    after checking the file contains extra lines after PHP end tag(?>). Removed the empty lines and spaces after the end tag solved the problem.

    Hope it will help someone.

  5. I realize that this is an old thread, but chances are that the problem resurfaces from the past like it did for me. I accidentally discovered the problem using a link to my login page without the SSL enabled. To give a quick fix I merely changed http:// to https:// in my browser and was able to log in to the admin panel. I had the problem a few months back and forgot that I updated my bookmarks to https, but the login link in the WP meta links in the widgets takes you to the unsecure page (which just bit me yesterday again). I’m not positive that this is the only cookie issue, but it has caught me twice now. I skimmed the wp-login.php and I think that line #768

    $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
    

    may be the problem, but sadly my time challenge doesn’t allow me to check further…

  6. You no need to worry about this issue in wordpress. It is the problem from functions.php page in your theme. The problem is that you need to remove spaces after and before closing of PHP tags. I mean
    1
    5
    6

    Note you need to clean up the code as follows.
    1
    I think you got my point. I faced the same issue and searched for the solution number of times. Finally I downloaded my theme into my local editor checked that functions.php page and cleaned up it as above. Finally, I resolved this issue. But, I spent 2 days to get the solution. Thanks. Braj