1. Check if you are changing your password in correct server and correct database
Many times people just mix databases or servers. If you are sure then check this post maybe it will help you. If this method didn’t solved your problem go to step 2.
2. Check your __PS_BASE_URI__ parameter in settings.inc.php file
Your PrestaShop isÂ installed in web server root directory or sub directory. If you moved your shop to other directory then __PS_BASE_URI__ is incorrect and you will not be able to log in to your back office anymore. Or you could change this parameter accidentally.
Find file /config/settings.inc.php. Open it with text editor and check __PS_BASE_URI__ parameter. If your PrestaShop is located in a sub directory then it should look like this:
If it is in web server root directory then it should look like this:
It helped to me but if you still cannot access your admin admin then go to next stepl
3. Hack your PrestaShop (you’ll need FTP access)
It’s not actually a hacking because you’ll need access to your PrestaShop php files but it will allow you to access PreStashop back office with correct email and any at least 5 symbols random password – PrestaShop checks password length before authentication.
This method is unsecure because anybody will be able to login with correct email and any long enough password.Â
OK find the file: your_admin_folder/login.php.
$employee = $employee->getByemail($email, $passwd);
Change it to:
$employee = $employee->getByemail($email, null);
Now try to login with correct email and at least 5 symbols random password. It worked for me – tested with PrestaShop 18.104.22.168 and 22.214.171.124
As I mentioned before this method is not actually hacking but it may be used for malicious purposes also
Well there is one more reason that can cause this problem – PHP bug: https://bugs.php.net/bug.php?id=42523
This problem was also reported to PrestaShop: http://forge.prestashop.com/browse/PSCFI-1110
If your PHP installation has this bug then $_SERVER[‘PHP_SELF’] variable will return the wrong value which is used in cookie path calculation.You can find this line in your admin folder/login.php file (54 line i PrestaShop 126.96.36.199):
$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));
Change this line to:
$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -10));
It resolved the problem for me.
Hope you liked this post. Feel free to comment or suggest ideas for new articles