PrestaShop - Cannot login to back-office after upgrade (1.7.2.0 -> 1.7.7.4)

Viewed 866

I have upgraded PrestaShop on my local machine (Xampp, PHP 7.4, MariaDB 10.1.22) according to official PrestaShop devdocs: https://devdocs.prestashop.com/1.7/basics/keeping-up-to-date/upgrade/

In front-office, everything seems to be okay. The problem I am facing is I cannot login into back-office now. After filling up correct email and pwd and click login button, it doesn't show any message and just reloads the page. If I fill up incorrect email or pwd, there is common error "The employee does not exist, or the password provided is incorrect."

I have also tried to login via incognito mode in Chrome, Opera or Firefox, but in each case the result is the same - reloading the login page.

PrestaShop domains in table ps_shop_url are ok. Variables PS_SHOP_DOMAIN_SSL and PS_SHOP_DOMAIN in ps_configuration seems to be ok too. I have also cleared the cache dirs (ps_root/var/cache, ps_root/cache, ps_root/app/cache) but again with no result.

Please, anyone could help?

Thank you very much

EDIT: After some debugging I found out what may causing this problem: In AdminControllerCore@init method, there is some employee checking at line 2804 ( !$this->context->employee->isLoggedBack() ), and this function checks validity of logged employee in back-office. However the employee id is null and it seems the id is not loaded from cookie... but I dont know why...

EDIT 2: Finally, there is a problem with validating cookie-checksum in method Cookie@update at these lines:

        /* Check if cookie has not been modified */
        if (!isset($this->_content['checksum']) || $this->_content['checksum'] != $checksum) {
            $this->logout();
        }

The checksums are not the same. Hence it logs me out everytime... Anyone knows what is this behavior caused by? I can just comment the logout line out and it works, but I understand that is not proper solution and may be a security risk...

Thanks!

2 Answers

This is a probably a cache issue.

Install the MyShopRepair on your server. Enable debug mode and click on the button "Clear cache".

After this you will have access to your shop again.

Prestashop 1.7.7 is not compatible with PHP 7.4. Try downgrading it.

PHP compatibility chart

Related