I have developed a website in Drupal 8 and have deployed it to production. I have created 7-8 other accounts for my content management team and have granted them limited privileges for creating, editing and deleting content.

Of late, I am facing a problem with the user login form, wherein the login works sporadically. Sometimes I am able to log in as the administrator in the first attempt, sometimes I am not. In the latter case, I have to reset my password via email using the reset password option. However, this approach works only temporarily for a single session, which means that as soon as I log out, I am unable to log in. My content managers are also experiencing the same problem.

I have tried the below things but no luck.

  1. Truncating the flood, session and all the cache tables and flood table manually from the database.

  2. Disabling the Recaptcha module in the login form.

  3. Enabling and disabling the HTTP Basic Authentication module.

  4. Disabling server proxy configuration through the settings.php file.

  5. Performing Drupal updates by running the update.php file.

The incorrect username and/or password error in the login has not been handled. When an incorrect username/password is entered the page only refreshes without displaying any custom message.

Please help!

  • what is the message you get in the logs ?
    – AlexB
    Apr 16, 2019 at 11:49
  • Try my answer to Cannot login after moving site
    – No Sssweat
    Apr 16, 2019 at 23:03
  • @AlexB Thank you for replying. First of all, sorry for responding late as I was extremely busy with personal tasks. While it's not possible to get the log messages as I'm not able to log in as the administrator, I was luckily able to get access to the backend since I had forgotten to log out from the account from another browser, Firefox. There is no log message. :( Also, the login works when the cache is cleared, but when logged out it again stops working. In order to login again, I have to clear the cache from the backend from Firefox. Any idea why this might be happening?
    – razor
    Apr 23, 2019 at 12:16

1 Answer 1


Okay, after much banging my head over the wall for nearly a week, I have found a workarpund solution to this problem by uninstalling Internal Dynamic Page Cache and Internal Page Cache modules.

The problem was that the user login form was getting cached after one successful login. Using the Chrome developer tools the following response header was getting set and sent by Drupal.

X-Drupal-Dynamic-Cache: HIT

To elimnate this I had to uninstall the above two modules.

However this is just a workaround and not a solution, since disabling these two modules will have a tradeoff with the site performance.

Anyone who knows the solution to this problem, please post it here. I shall try them and update this space.

Thank you in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.