Search code examples
phpprestashopprestashop-1.7

Impossible to log in to Backoffice in PrestaShop 1.7.2.0


Error description: nothing is shown when trying to log in.

We enter user (mail) and password, it tries to log in but nothing happens. Inspecting browser’s console but no error is shown, nor even a clue to follow.

Additional information:

  • PrestaShop version: 1.7.2
  • PHP version: 7.1.33
  • Database client version: libmysql - 5.1.73

We've tried this:

  • Empty the cache and cookies
  • Verified PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL on ps_contiguration table
  • Cache manual deletion on app/cache/dev and app/cache/prod
  • Deactivation of IP check at clases/Cookie.php commenting the condition:

    (!isset($this->_content['remote_addr']) || $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP’))

In the route /PROJECT_FOLDER/classes/controller/AdminController.php

we’ve replaced this:

if ($this->context->cookie->last_activity + 900 < time()) {

by this:

if ($this->context->cookie->last_activity + 3600 < time()) {

Solution

  • SOLVING.

    The error was an admin login loop. it was a server error due to excess ajax requests

    I leave the solution in case someone else has the same problem:

    In ps_configuration table disable PS_COOKIE_CHECKIP

    before:

    PS_COOKIE_CHECKIP = 1

    then:

    PS_COOKIE_CHECKIP = 0