Magento cannot log in with user and password rights

I just installed Magento(1.7.0.2) on my localhost (LAMP) recently. Now after installation, when I wanted to go to the admin panel, he asked me to enter a username and password. Although I used the correct username and password, showing it Invalid User Name or Password . I cleared my browser cookie but again showed me the same login problem. I looked at google and got what I can login using http://127.0.0.1 instead of http://localhost . But it still does not work for me. I browsed all of Google all day, and as some blogs said that just make some comments on the line in the varien.php file, I also made comments in the varien.php file, but still did not work for me (since I use here 1.7. 0.2 and the blogs they talked about 1.6.X). I installed magento 4 times today, but still I ran into the same problem over and over again. Can someone tell me how to solve this? Any help and suggestions would be really noticeable.

+7
source share
11 answers

If you are having trouble registering with the correct username and password, here are a few ideas. If you used google chrome to install magento, use firefox to open magento and edit the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php in your magento directory and comment on those lines below.

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

And use your login credentials. I hope this works for you.

+48
source

follow these steps:
1: pass: xampp \ htdocs \ magento \ app \ code \ core \ Mage \ Core \ Model \ Session \ Abstract \
2: open the Varien.php file
3: enter the comment line number from 87 to 104 save it and try logging in ...

+3
source
  If you are suffering to get logged in with the correct username and password. replace the code with the New code Original code:- $cookieParams = array( 'lifetime' => $cookie->getLifetime(), 'path' => $cookie->getPath(), 'domain' => $cookie->getConfigDomain(), 'secure' => $cookie->isSecure(), 'httponly' => $cookie->getHttponly() ); New Code:- $cookieParams = array( 'lifetime' => $cookie->getLifetime(), 'path' => $cookie->getPath() /*, 'domain' => $cookie->getConfigDomain(), 'secure' => $cookie->isSecure(), 'httponly' => $cookie->getHttponly() */ ); File Path :-app/code/core/Mage/Core/Model/Session/Abstract/Varien.php 
+2
source

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

  • Configure the host file to redirect www.localhost.com to 127.0.0.1
  • Remove application /etc/local.xml
  • Reinstall Magento using www.localhost.com as the URL (with validation of the missing URL).
  • Save username and password
  • Delete cookies and try again

I recommend number 3 as you mentioned changing the kernel code (never a good idea)

0
source

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

2. Find and comment on the following 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
source

** As mentioned by James. This method worked for me. This is a better option, not a code change. It worked for me on 127.0.0.1, as well as on localhost, and after uninstalling the /etc/local.xml application. Delete browser cookies. Run the magento installation in your browser

local / Magento / index.php.install.htm

and enter your username and password again. Log in to your admin panel. I did not need to delete the magento database so that my data was safe. ****

0
source

This is not the right way to comment on cookie settings because in the future it will click on the server and make a lot of problems. I know this from personal experience.

The best solution is to rename the local url to a form that more or less looks like a typical URL with at least a dot in the line. As an example: http: //yoursitename.local

0
source

I agree with -Checkpoint Charlie that cookie parameter comments may cause future problems.

If you are installing magento on a local server, you should install it using the IP address 127.0.0.1/magento_install_path, not localhost / magento_install_path. Localhost does not accept cookies for installing magento (or something like that), this is due to the magento installation rules.

0
source

This problem also occurs when the disk quota is exceeded on the server, and apparently the session information cannot be written to the disk if a cookie-based cookie storage is used.

0
source

It works for me .. Please follow the instructions below.

Go to System-> Configuration-> Web-> Session Management

change Use Only HTTP to None

enter image description here

0
source

In fact, there is no programming and problem setting for this problem.

  • Find this snipet code from Varien.php and replace it below

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

  • Clear your browsing history with cookies for good practice.
0
source

All Articles