I've just restored a backup of my site, but now whenever I try and login I get a "Invalid username or password" error. I've tried resetting the password, but even the new password brings up the same message. Any ideas what could be causing this?
Might seem like a silly question, but are you sure you're looking at the correct database for the site? For example, do you have a development site/database/configuration file?
Cookie/Session problems will normally just bounce you to the homepage or back to the login screen. This sounds more like an actual problem authenticating the username/password which really can only be because what you're typing in doesn't match what's in the database table.
Few things you can try here, sessions is the likely suspect.
Firstly try clearing your browser cache, or in a browser like Chrome for example, open up an incognito tab, which will temporarily give you a session without any preexisting cookies to mess things up.
In combination with the above, you can try clearing your exp_sessions table, which will force EE to forget any previous sessions stored in the DB.
In theory if it's sessions causing a failure to login then this would solve your problem.
What you can also try, although I wouldn't expect this to make any difference if the above dont:
Open your config.php, and look for this line:
$config['admin_session_type'] = "c"
Insert a random value in there, for example:
$config['admin_session_type'] = "x"
This will change the name of the sessions being created, again fooling EE into creating brand new sessions rather than matching existing ones.
Check that the user account you are trying to log in with is present in
exp_members in the database. The password will be salted and hashed but you can at least confirm the presence of the account.
Ensure that browser caches are cleared, along with the system cache directory: system > expressionengine > cache.
If that still fails then it may be possible that the restore didn't quite complete successfully for some reason so try it again and ensure that you set it to Drop any existing tables already in the database.