WordPress.org

Ready to get started?Download WordPress

Forums

[closed] ERROR: Cookies are blocked or not supported by your browser. (18 posts)

  1. bella2011
    Member
    Posted 7 months ago #

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

    After updating WordPress from 3.7.1 to 3.8, when I attempt to login at (http://mydomain.com/wp-login.php) I receive the above mentioned error message.

    This occurs in Firefox and IE. When logged into Chrome -- you can't logout.

    I have done the following:

    - Ensured cookies are not blocked
    - Deactivated all plugins
    - Substituted the wp-login.php from version 3.7.1
    - Commented out lines 744-746 in wp-login.php as recommended here: http://bit.ly/19cgudZ

    This seems to have happened to some people with 3.7.1 and now 3.8. Does anyone know how to fix this login issue?

  2. Mrinal Kanti Roy
    Member
    Posted 7 months ago #

  3. bella2011
    Member
    Posted 7 months ago #

    Hi Mrinal,

    Thank you for the recommendation, however, we have already been in touch with our host - HostGator and it is not a server issue.

  4. Mrinal Kanti Roy
    Member
    Posted 7 months ago #

    Hi

    Did you tried the .htaccess file editing?

  5. bella2011
    Member
    Posted 7 months ago #

    The back-end of the site was working fine prior to the WordPress 3.8 upgrade. Here is a screenshot of the error: http://bit.ly/1d5jn1l.

    Not sure how (or why) to edit the main .htaccess file to remove this error? The 3.8 upgrade was completed via the WP dashboard.

    (Note: Everything seems to work fine except for the inability to log-in due to this error and white pages showing up when an action is taken (i.e., activating a plugin or saving a post).)

  6. Mrinal Kanti Roy
    Member
    Posted 7 months ago #

    Hi Bella,

    Got a solution

    Add the following codes at the end of wp-config.php file at root folder.

    define('ADMIN_COOKIE_PATH', '/');
    define('COOKIE_DOMAIN', '');
    define('COOKIEPATH', '');
    define('SITECOOKIEPATH', '');

    Clear your browser cache & check the issue again.

  7. bella2011
    Member
    Posted 7 months ago #

    Hi Mrinal,

    Unfortunately the above mentioned code does not work when added to the root wp-config.php file. Thank you for trying. Hopefully someone knows how to fix this issue.

  8. Chad Huntley
    Member
    Posted 7 months ago #

    @Mrinal, your solution worked for me, but with some strange effects.

    I added those lines to config then logged in successfully. I then removed the lines, and was then permanently stuck in the admin panel. It would not let me log out, it would just go right back into the admin panel after clicking logout!

    So I re-added the lines, then successfully logged out. I then removed the lines, and it automatically logged me back in. So I logged out again and everything appears to be normal.

    WordPress team, you really need to look into this [Moderator note: There is no WordPress team]

  9. leopoldkristjansson
    Member
    Posted 6 months ago #

    I would love to have the solution for this... I've tried all of the above.

  10. Artem Livshits
    Member
    Posted 6 months ago #

    I had to debug this issue today. The actual solution may not be applicable to you, but I thought I'd share the debugging steps so that you may get more insight into what's going on, or at least provide more information for others to looks into.

    Here are the steps for debugging in Google Chrome:

    1. Go to the login page (e.g. example.com/wp-login.php).
    2. Press Ctrl-Shift-C (or right-click on the page and choose "Inspect element") to open developer tools.
    3. Enter the credentials and hit Log In -- get the "Cookies are blocked ..." error.
    4. In the developer tools pane, switch to the Network tab.
    5. In the Network tab, click on the top most item (e.g. wp-login.php).
    6. Select Headers tab and scroll down all the way to see the response.
    7. Look at the Set-cookie headers, pay attention to path= and domain=.

    The "Cookies are blocked ..." error happens when the wordpress_test_cookie doesn't get returned by the browser, which is likely to be caused by improperly set domain or path.

    Here is a screenshot that illustrates the steps and the issue.

    In my case, the problem was that WordPress set domain to the internal site name, and Chrome apparently decided to reject the cookie because it thought that the internal host name is a top level domain name or something (this behavior in Chrome got broken recently, it used to work). The workaround was to add

    define('COOKIE_DOMAIN', false);

    to wp-config.php. This is not necessarily a solution, but was good enough for me to proceed with what I needed to do.

    Good luck with figuring this out!

    -Artem

  11. Bernardo Medeiros
    Member
    Posted 5 months ago #

    I'm going to try Artem's solution.

    One of my sites is having this problem with some users.

    If anything changes, I'll be happy to know.

    Thanks

  12. Brad Williams
    Member
    Posted 5 months ago #

    Artem's response helped me debug and figure out my problem. The problem was wp-config had define('COOKIE_DOMAIN', 'www.liveurl.com');, but I was logging into a staging site with a different URL. I updated the URL to be the proper URL, cleared my browser cached, and was able to log right in.

    Thanks!

  13. olemissnewmedia
    Member
    Posted 4 months ago #

    I am having the same problem with this (ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.) It happened when I tried to install the Twitter plug in.

    Here's the issue: How can I deactivate the plug in (which apparently solves the problem) when I can't log into the site in the first place? I talked to the host (Hostgator) and they said the problem is WP.

    Please help!

  14. Artem Livshits
    Member
    Posted 4 months ago #

    How can I deactivate the plug in (which apparently solves the problem) when I can't log into the site in the first place?

    You can delete the plugin sources from the wp-content/plugins directory. This should deactivate the plugin. Googling for "how to deactivate wordpress plugin" gives plenty of other options.

  15. livathebeach
    Member
    Posted 4 months ago #

    I'm not sure how it happened, but after trying multiple hacks/fixes, I opened my wp-config.php file and it was all one line, therefore the entire thing was commented out. So, not sure if anyone else has this problem, but take a look at wp-config.php, because after fixing it, I could login again.

  16. igor3063
    Member
    Posted 3 months ago #

    @Artem: I do not post often but the solution you provided worked just fine for my Multisite. Thanks a lot!

  17. illum
    Member
    Posted 3 months ago #

    Thank you Artem. Your wp-config workaround solved a similar issue on 3.9 multisite.

  18. abeasley54
    Member
    Posted 2 months ago #

    I was very hopeful that the fix by Artem would work, but not in my case.

    I moved my development site from a localhost server to a live production server, while adding the below to my wp-config:

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');

    Usually this works flawlessly but this time not so much. After reading Artem response, and being that his fix did not work for me, I went back into my DB and decided to traditionally change the domain with a migration.

    Editing the following in the database from the options table:

    option_id	option_name	option_value
    	1	siteurl         http://changehere.com
           36       home            http://changehere.com

    Cleared cache refreshed and BAM! im in. It was such a DUH moment for me. Hope this will help others as well.

    Thank you Artem as well. Without your post I would have never guessed it to be because of an incorrect domain.

Topic Closed

This topic has been closed to new replies.

About this Topic