Admin login page just reloads without errorsΒΆ

Many of you run into this problem, when entering correct admin login/password and hitting the submit button, the page just re-loads without any errors. There are many solutions for this problem but none of them worked for us, because they miss a specific record.

Here is the solution for Magento 1.5.x+:

  • You should edit the following file app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. This is Magento core file so don’t forget to backup it before changing.

  • Find the code:

    $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath(),
        'domain'   => $cookie->getConfigDomain(),
        'secure'   => $cookie->isSecure(),
        'httponly' => $cookie->getHttponly()
    );
    

    and replace it with this one:

    $cookieParams = array(
        'lifetime' => $cookie->getLifetime(),
        'path'     => $cookie->getPath(),
        //'domain'   => $cookie->getConfigDomain(),
        //'secure'   => $cookie->isSecure(),
        //'httponly' => $cookie->getHttponly()
    );
    

    i.e. you need to comment 3 lines out.

  • Then find the code:

    if (!$cookieParams['httponly']) {
        unset($cookieParams['httponly']);
        if (!$cookieParams['secure']) {
            unset($cookieParams['secure']);
            if (!$cookieParams['domain']) {
                unset($cookieParams['domain']);
            }
        }
    }
    
    if (isset($cookieParams['domain'])) {
        $cookieParams['domain'] = $cookie->getDomain();
    }
    

    and comment it out or you can replace it with the code:

    if (!$cookieParams['httponly']) {
        unset($cookieParams['httponly']);
        if (!$cookieParams['secure']) {
            unset($cookieParams['secure']);
            if (!$cookieParams['domain']) {
                unset($cookieParams['domain']);
            }
        }
    }
    
    if (isset($cookieParams['domain'])) {
        $cookieParams['domain'] = $cookie->getDomain();
    }
    
    call_user_func_array('session_set_cookie_params', $cookieParams);
    
  • Save the changes. Note: you need to remove site cookies in your browser after that to test this solution.

Should you have any questions on this article or would like to learn more about our Magento plugins, Magento 2 extensions or services, we will be more than happy to help. To submit your request, please follow this link.