Why I can not login to magento backend using google chrome

后端 未结 9 1900
萌比男神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:35

    If on firefox works. Then the problem is cookies on chrome, try to clear your chrome's cookie.

    0 讨论(0)
  • 2020-11-29 04:36

    Our Chrome users were unable to add items to their cart... changing the Cookie Lifetime to the recommended 86400 fixed it.

    Magento Community 1.7

    Thank you!

    Jeff

    0 讨论(0)
  • 2020-11-29 04:43

    the problem is that chrome isnt storing the login cookie, this can be seen by looking at the cookies in chrome | settings | content | advanced | all cookies and site data

    there's probably a number of reasons why this can happen, cookie lifetime for sure is one of them..

    personally I encountered this problem when running magento in localhost / on a virtual machine and connecting from a browser on the same machine. specifically the problem seems to be that chrome will not store cookies if the domain name is not qualified. so if your domain name is 'http://localhost/magento' or 'http://somename/magento' chrome will not store the cookie and consequently you will not be able to login

    here's the fix:

    to keep this simple i'm sticking to the example where magento is running on localhost. the same trick will work if magento is running on a vm and you're accessing from localhost, but you need to modify the hosts file on both guest os and client in such a case. (and remember that the guest ip can change so from time to time you need to update the hosts file on the host)

    first choose your domainname. it's only in local so you dont need to register. i'm choosing 'dansmagentodev.com'. then in magento | system | web modify baseurl in both secure and unsecure to be http://dansmagentodev.com/magento/

    next, in the same place, modify the session cookie management 'cookie domain' to be 'dansmagentodev.com'

    next we need to configure your system to know that dansmagentodev.com is really localhost. we do this via the hosts file. on windows this file is in C:\Windows\System32\drivers\etc\hosts. your virus checker will probably try to stop you modifying it (for good reason, disable virus checker while you make the modification). then add the line 127.0.0.1 dansmagentodev.com

    And now log in from chrome.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-29 04:47

    If you enabled the https for the Magento admin panel, then make sure to set "NO" for the option "Use HTTP Only" under System->configuration->web->Session and Cookie Management."

    If you have access to the database then open the table "core_config_data" and search for the Path "web/cookie/cookie_httponly" and set the value to "0".

    Make sure to delete the var/cache folder. Now try to login to Magento admin panel. Mostly you can now. If not post your issue in this thread.

    So this "Not able to login Magento admin panel" issue mostly relates to the Magento cookies settings. So don't get worried if you encounter this tiny issue. With the list of answers in this thread you can easily sort this out in a few minutes time.

    0 讨论(0)
  • 2020-11-29 04:48

    My problem was the fact that the server I was running was an Ubuntu fresh install with very little server maintenance configuration.

    It had not updated it's date & time and it was 3h behind.

    This made cookies received by Chrome to look as if they were already expired so Chrome discarded them.

    0 讨论(0)
提交回复
热议问题