4

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?

4 Answers 4

4

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.

4

Try adding these lines on the bottom of your expressionengine/config/config.php file:

$config['cookie_prefix'] = '';
$config['cookie_path'] = '';
$config['cookie_domain'] = '';
$config['user_session_type'] = 'c';
$config['admin_session_type'] = 's';
4
  • Thank you, Nikola -- this saved me from a hours-long fight with a stubborn cp login screen. Oct 18, 2014 at 1:34
  • Happy to help :) Oct 20, 2014 at 11:11
  • 1
    Just so you know this is a good solution more than four years later! Thank you.
    – forrest
    May 28, 2019 at 4:52
  • I'm happy to hear this is still being useful. it has been ages since I dealt with that project Expression Engine project. :) Jul 19, 2019 at 14:44
1

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.

2
  • I've cleared caches, both in browser and on EE. Tried logging in on incognito mode, still can't log in. And the sessions table is blank anyway. Apr 25, 2013 at 9:11
  • Try turning on debugging for your admin index.php, look for the line $debug = 0; and change it to $debug = 1; Then see if it reports any errors when you try and login.
    – neekster
    Apr 25, 2013 at 11:27
0

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.

3
  • The account is in exp_members, the system is returning the username and password when I reset it. But it still tells me that same username and/or password are invalid. Apr 25, 2013 at 9:15
  • Any success logging in yet?
    – Ian Young
    Apr 28, 2013 at 19:40
  • I ended up restoring an older backup - the oldest one I have. Now I can log in, but I've got a new problem. Apr 30, 2013 at 18:42

Your Answer

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

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