Support » Fixing WordPress » Unable to Log In –Cookies Are Blocked Due To Unexpected Output?

  • I just started getting this message tonight when attempting to log in.

    ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums-

    I had a tech at IPage attempt to log in and he got the same message. I’ve tried it in Chrome, Firefox, and IE. Also, I have another wordpress site that’s working fine. So I don’t think it’s cookies on my end.

    I had issues with the editor after the 3.9 upgrade but it was related to my HeatMap theme. I got it fixed. Now this.

    The site is working normally on the front end and I’m still logged in on one computer from earlier today. I just won’t be able to get back in if I lose that connection. I’m wondering if I should try and reload 3.9 while I’m still logged in.

    Any suggestions or help would be greatly appreciated.

Viewing 15 replies - 1 through 15 (of 36 total)
  • I have the exact same problem, it started all of a sudden about 9 hours ago. Also tried different browsers, ipad, etc. Problem still exists. Hope someone can help us. Thanks in advance, Richard

    The same problem during login in wp-admin page. When newly created theme directory is deleted everything works fine, when pasted, the same problem happens during login.
    But when I run the same website in my computer using xampp, no such thing happens.
    Please help me with this: ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.
    Thanks in advanced..

    I’ve tried to login and it shown same alert but have no solution.
    I think this is only for new update of 3.9. Can anyone give the solution.

    I saw that this problem was discussed a couple of weeks ago on: https://core.trac.wordpress.org/ticket/27373 but the discussion shows no solution. So I defined a new ticket there: https://core.trac.wordpress.org/ticket/27974#ticket

    Hope we get an answer soon.

    rgrds,

    Richard

    Try to edit wp-config.php. Before saving (or save as) ensure the file encoding is UTF-8, not UTF-8 BOM. This helped here.

    Windows Notepad and others have a file encoding selection is “save as” dialog. Others may have it as a document setting for the file being edited.

    If your editor show any characters before <?php at start of line 1, remove these and save. This means that your editor doesn’t recognize the “BOM” bytes at the start of a file. WordPress may have the same problem.

    My solution was to turn ‘WP_DEBUG” in wp-config to true (located on line 81) and after trying to log in I was directed to the offending piece of code (was was shown on the top of the page).

    Mine was located in my theme’s functions.php, turned out to be the script I added to include fontawesome. I simply removed this script and was able to log back into the dashboard.

    I tried the solution of Knut first: opened wp-config.php in MS notepad and saved as UTF-8 (there is no option UTF-8 ROM, only ANSI, unicode and UTF-8). That didn’t work. Then I tried the solution of Coiot: opend wp-config.php in notepad and changed the WP_DEBUG value to ‘true’. That didn’t work also. Still getting the message “ERROR: Cookies are blocked due to unexpected output.” I tried to log in after the above steps but couldn’t. Hope other solutions come available soon. Thanks in advance.

    I also tried this: I downloaded and installed notepad ++ http://notepad-plus-plus.org/ Opened the wp-config.php in notepad ++
    Then went to menu ‘coding’ (or similar, I have the Dutch version) and clicked on the second option: “UTF-8 without BOM”
    Then saved the file normally and uploaded it to my /wp directory. That didn’t work also.

    I’m getting closer to the solution. I use a WP-theme from http://www.themefuse.com I wanted some English text to be replaces by Dutch text, so with instructions of the themefuse-moderators, I modified a certain file. After that, the problem occured.
    What I did then was deliberately change the name of the plugins-map to see what the error code would be. When I went back to the login-page, i got this:

    +++begin errorcode
    Warning: Cannot modify header information – headers already sent by (output started at ../wp/wp-content/themes/medica-child/theme_config/widgets/TF_Widget_Contact.php:1) in ../wp/wp-login.php on line 414

    Warning: Cannot modify header information – headers already sent by (output started at ../wp/wp-content/themes/medica-child/theme_config/widgets/TF_Widget_Contact.php:1) in ../wp/wp-login.php on line 426
    +++end errorcode

    So that gave me the answer: this file is somehow corrupted. I have backups so I can restore this file to see what happens. I’m 99% sure this will solve it. But to make sure everything goes well, I’ll do that together with the themefuse-moderators (when they’re awake, it’s 10.30 in the morning here in Holland).

    As soon as I’m any further on this, I’ll report here. For others: try to change the name of the plugins-map. See what errorcode you get on the top of the loginpage and to which file it is pointing. Then try to troubleshoot that file or replace the file with a backup file. (In case the UTF-8 without BOM thing isn’t working)

    It seems the general rule is:

    Never use Windows Notepad to edit program files, PHP especially, that is to be transferred to, and used on, a Linux server.

    Most hosting services use Linux variants. For Windows servers there is no such problem, naturally.

    There should be no problems using Notepad on Windows to edit theme & plugin files for a *nix server. People use it all of the time without any issues.

    I just encountered this same problem, and solved it using advice I found here.

    The main two potential causes, it seems are:

    One of the active plugins (or the theme’s functions.php file) produces unexpected output, causing a “headers already sent” warning and consequently preventing WordPress from setting the test cookie.
    UTF-8 byte order mark in wp-config.php (or theme’s functions.php file) has the same effect as above.

    The solutions for these issues are:

    In case of a plugin issue, the solution would be to rename its folder via FTP. In case of a UTF-8 byte order mark issue, the solution is to re-save the file without it. Notepad++ has an option for that: “Convert to UTF-8 without BOM”.

    In my case, per the suggestion above, I basically used my FTP to systematically rename each of my plug-ins (to force it to deactivate), then refreshed the login page after each plug folder name change to see if the error disappeared. After isolating which plug-in caused the error, I was able to log in, and deleted my current installation of the plug-in. I then re-installed the same plug-in, and it worked without a hitch.

    I hope that helps!

    Hi everyone,

    here’s another solution, but for Mac users. I was experiencing the same error. I’ve got a theme with a lot of custom functions in its functions.php and found the problem was caused by this file. Here’s what I did:

    1. Renaming plugin directories one by one and trying to login. If problem still occurs, go on.
    2. Go back to standard theme. If problem disappears, your theme might be the problem.
    3. Reactivate your theme and rename functions.php. Reload Login. If the problem disappears you know its the functions.php that causes it.
    4. Get smultron editor (it’s free), create a new file and set “Line endings” to “Unix” and “Text Encoding” to “UTF-8”
    5. Now start copying functions from the old functions.php to the new one – one by one. After every single function upload the file and reload the login page. The error should disappear after the first upload.

    Some notes: I didn’t code most of the stuff in the functions.php so I wasn’t sure if the problem was based on crappy coding or just encoding problems. It seems it was the latter, but others reported some custom functions won’t work with 3.9. I guess the best way is to check it the way I described above – step by step… For me, it worked 😉

    Regards,
    Chris

    I solve my issue and its really working. When I caught it and surprizing to see my mistake in in functions.php

    At the end of the code you can’t close php tag, if you close then it showing this error which i’ve got. So now functions.php is starting with “<?php” and finish with as usal , never can put the end php tag such as “?>”

    Now onwards my wordpress is running with no more problem. If somebody have a time you can check it. [Link removed]

    Hello everyone,

    I have the same problem, I have tried all the above mentioned solutions but nothing could work in my case. Can anyone give any other solution.

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘Unable to Log In –Cookies Are Blocked Due To Unexpected Output?’ is closed to new replies.