I am not able to login on my site. All the times I try, I get this error:

Sorry, unrecognized username or password. Have you forgotten your password?

I checked 10 times, but the password I use is correct.

I am not sure what happens; even if I try to create a new account, and login, I still get the same error.

I was able to login with that username and password previously, even on live, where I am still able. It is just on local where I cannot login anymore.

mod_rewrite is enabled on the server, so the problem cannot be that. I noticed that the session is automatically destroyed, for the administrator user.

Why does this happen?

  • @CodeNext : any idea why this is happening? Jul 14, 2016 at 7:10
  • No idea, sorry, there must be some other issue, if you are able to use login with same pw & un. Please modify your question and add this detail as it is important, so someone can answer.
    – CodeNext
    Jul 14, 2016 at 7:16
  • Try drush user-login?
    – Jimmy Ko
    Jul 14, 2016 at 8:24
  • Which version of Drupal? Is it 7.50 already? Jul 14, 2016 at 8:25
  • Can you change the password using drush and see if you can login then? drush user-password admin --password="password" (if the user name is 'admin') - this will change the password from user 'admin' to 'password'. Jul 14, 2016 at 8:29

2 Answers 2


Please check:

  • your cookie_domain value in your settings file

    Normally it should work when it's empty, however if you're using across multiple domains or protocols (e.g. form is HTTP, but you're submitting to HTTPS), you should set it to its full domain name, so Drupal automatically generates a unique session cookie name for each site. E.g.

    $cookie_domain = '.www.example.com';

    or assign it dynamically like (not recommended):

    $cookie_domain = @$_SERVER["SERVER_NAME"];
  • watchdog logs, e.g. drush ws --tail,

  • if you're using LoginToboggan or similar, check whether you should use username or e-mail to login,
  • whether cookies are created fine in DevTools console,
  • if you're using Varnish, check whether cookies are deleted,
  • try login to the site using one time login link, e.g. via drush uli command and verify that your account works (it's not blocked or something),
  • try in another browser or in incognito mode,
  • disable any 3rd party authentication modules (ldap, openam, etc) which may override the default logic,
  • debug your code using XDebug.

It is likely that your multiple login attempts have resulted in an entry in the flood table which is blocking your IP address.

You can access the database using drush and then delete the records from the flood table.

drush sql-cli

Will open a command line interface (cli) for your database.

To see entries in the flood table:

select * from flood;

To delete all entries from the flood table:

delete from flood;

To exit the cli:


(The above commands will work in MySQL. They may be different in other DBs.)

Helpful Documentation on Drupal.org

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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