Why I can not login to magento backend using google chrome

后端 未结 9 1924
萌比男神i
萌比男神i 2020-11-29 04:02

I am using magento community edition 1.7.0.2.I am not able to login to back end of magento.I know this problem can be because of chrome not accepting cookies. But how to fi

9条回答
  •  遥遥无期
    2020-11-29 04:46

    There are two solutions for this, either one will work:

    • Change the cookie lifetime configuration.Go to backend -> Sytem -> Configuration -> Web -> Session and Cookie Management Set cookie lifetime to 86400 and save it .

    see here

    • Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

    Find the code:

    session_set_cookie_params(
    $this->getCookie()->getLifetime(),
    $this->getCookie()->getPath(),
    $this->getCookie()->getDomain(),
    $this->getCookie()->isSecure(),
    $this->getCookie()->getHttponly()
    );
    

    or

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

    and replace with

    session_set_cookie_params(
    $this->getCookie()->getLifetime(),
    $this->getCookie()->getPath()
    //$this->getCookie()->getDomain(),
    //$this->getCookie()->isSecure(),
    //$this->getCookie()->getHttponly()
    );
    

    or

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

    After this save the file.

提交回复
热议问题