Why can I not login on my live site? 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?
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.