Magento can't login in admin with right username and password

前端 未结 11 2468
南笙
南笙 2020-12-24 10:17

I just freshly installed Magento(1.7.0.2) on my localhost(LAMP). Now after installation when I wanted to go for the admin panel it asked me for the username and

相关标签:
11条回答
  • 2020-12-24 10:40

    I agree with -Checkpoint Charlie- that commenting cookie params may cause future trouble.

    If you install magento on local server, you have to install it using the 127.0.0.1/magento_install_path IP not localhost/magento_install_path. Localhost does not accept cookies for magento installation(or something like that), it has to do with magento rules on installation.

    0 讨论(0)
  • 2020-12-24 10:42

    If you cannot log in, here is what I would do:

    1. Set up your host file to redirect www.localhost.com to 127.0.0.1
    2. Delete app/etc/local.xml
    3. Re-install Magento, using www.localhost.com as the URL (with skip URL validation)
    4. Save username and password
    5. Clear cookies and try again

    I'm recommending number 3 as you've mentioned modifying core code (never really a good idea)

    0 讨论(0)
  • 2020-12-24 10:44

    do these steps :
    1: go through: xampp\htdocs\magento\app\code\core\Mage\Core\Model\Session\Abstract\
    2: open Varien.php file
    3: make comment line number from 87 to 104 save it and try to login...

    0 讨论(0)
  • 2020-12-24 10:44

    1.Open Varien.php file Location app\code\core\Mage\Core\Model\Session\Abstract.

    2.Find and comment the bellow 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();
       }
    

    Source http://infynet.wordpress.com/2013/07/17/admin-login-fail-in-magento/

    0 讨论(0)
  • 2020-12-24 10:44

    In fact there is no programming and set up issues for this problem.

    1. Find this code snipet from Varien.php and replace as below

      if ((isset($cookieParams['domain'])) && !in_array("127.0.0.1", 
            self::getValidatorData())) {
            $cookieParams['domain'] = $cookie->getDomain();
      }
      
    2. Just open another browser and open the local magento page with 127.0.0.1 instead of localhost.

    3. Clear the browser history with cookie for good practice.
    0 讨论(0)
提交回复
热议问题