Support » Fixing WordPress » Can't Login ADMIN (Cookies Problem)

  • Resolved ericfkw



    I have a website just launched to public, but after it launched it failed to login Admin area due to following error:

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

    Before the website launched, we have setup a development environment for uploading content and it all works properly, which is a different domain between development and production ( and but share the same virtual directory. i.e. /var/www/html/mysite/, virtual host controlled by a apache .conf file.

    I googled some document and find there is a solution on remark out the check cookies lines in WP-LOGIN file, I tried but no luck.

    Would it have any other possible fix? Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello, ericfkw, & welcome to the WordPress support forum.

    It’d be most helpful if you provided an actual as opposed to hypothetical site url, but, having said that, you may find a recent topic in which I participated to be helpful:

    Basically, you’ll need to do a search-&-replace on your database in order to replace all instances of the old localhost url w/your new url.

    Please read that thread & let us know if anything is unclear or if you require additional assistance. Good luck w/your website.

    Moderator t-p


    I think it’s more like to be a server sessions or cookie issue than a core one. Have you spoken to your hosts about it. Or checked your error logs?

    Thread Starter ericfkw


    @jackie McBride,

    Thanks, I tried replaced all the instances of old string to new. The old one we are using is exactly a valid domain like, so we haven’t used localhost before for the development.

    Now, while entering the site with old URL described above, it will auto changed to new URL, supposed it is because the value settings in wp_options table(‘siteurl’ and ‘home’ column), but the Admin panel is still no luck to enter.

    The same Error happens.

    Do I need to create a new virtual host and setup the wordpress again?

    Very Thanks for your help.

    Thread Starter ericfkw



    Thanks. Sorry haven’t said that which is our own server setup on Amazon, not a public hosting. I checked Error log but no insight on Admin login issue, it just logged below:

    (4)Interrupted system call: FastCGI: comm with server “/var/www/cgi-bin/php-fpm” aborted: select() failed


    Eric, what happens if you use wp-login.php rather than wp-admin?

    Also, when I go to
    I do get a login screen.

    Do you have anything in your wp-config.php file or your theme’s functions.php file regarding url?

    Is this a single or multisite installation, and may we please see your .htaccess file?

    Thread Starter ericfkw


    Hello @jackie McBride,

    Very thanks for your help. Finally I got the key to the issue and now fixed.

    Which is about he CloudFront setting on AWS, as by default it hasn’t forward cookies, I then added some new behavior for wp-admin* and wp-login* usage then now works!

    So the problem should not be issue if haven’t behind CloudFront(old URL hasn’t set that) but on new one with CloudFront then issue happen.

    So to make it clear, which is not WordPress settings problem. 🙂

    Again, very thanks!


    Moderator t-p


    Glad to hear it 🙂

    Hey @ericfkw are you able to share the exact settings that you used? I am having the same issue.

    Thread Starter ericfkw


    Hello @kamarch,

    I had set the following in CloudFront:

    Behavior, add following:
    0 wp-admin*
    1 wp-login*
    2 wp-admin/admin-ajax.php
    3 wp-includes/*.php

    And in each above Behavior Settings:
    Forward Headers -> All
    Forward Cookies -> All (Actually can set Whitelist but need to list them all)
    Forward QueryString -> Yes

    Hi @ericfkw. I am following your exact rules and it throws 404 errors when I try to access wp-admin, but frontend is working

    Hello guys im having problem to login. I can login, tried a lot of things already. Cache and cookies are clean, all uploaded a new wplogin.php on my server, nothing changed…

    I user the debug to check where the error is and i got:
    Cannot modify header information – headers already sent by – ……..wp-login.php on line 390
    Cannot modify header information – headers already sent by – ……..wp-login.php on line 403

    this is my login php page

    [massive code redacted – please use a paste service like pastebin og GitHub Gist for large code chunks]


    • This reply was modified 4 years, 8 months ago by Marius L. J..
    • This reply was modified 4 years, 8 months ago by Marius L. J.. Reason: Redacted huge code blob

    I can´t login in my backend. I see always this cookie error:

    I already checked my config.php. Also I saved it again in UTF8. And the Problem ist not my browser. It would be great if anybody could help me.


Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Can't Login ADMIN (Cookies Problem)’ is closed to new replies.