Magento admin login not working in chrome but works fine for firefox

前端 未结 15 2773
自闭症患者
自闭症患者 2020-12-04 14:23

I am just a newbie to the magento. I have installed magento on my localhost. After all the setup when I used the admin page to login I can\'t able to login in chrome browser

15条回答
  •  长情又很酷
    2020-12-04 15:20

    As the accepted answer pointed out, the problem lies with chrome when accessing Magento on a localhost. Wrap the code in theapp/code/core/Mage/Core/Model/Session/Abstract/Varien.php with the following snippet, and the session parameter array will be only reset if you are on localhost (IP'127.0.0.1' or '::1').

    // SNIPPET Part 1: add this before the original array definition
    // -----------------------------------------------------------
    
    if(in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
        $cookieParams = array();
    } else {
    
        // here comes the original code, thats what you should
        // look for but not touch
        // -------------------------------------------------------
    
        // session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path' => $cookie->getPath(),
            'domain' => $cookie->getConfigDomain(),
            'secure' => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );
    
    // SNIPPET Part 2: add the closing bracket
    // ------------------------------------------
    
    }
    

提交回复
热议问题