Few days back I had plan to explore magento as there are much hip-hop of it now a days. As a web developer I was curious to know how much powerful it is with compare to osCommerce, Zencart, x-cart and CRE-Loaded. I have setup magento on my machine using XAMP using http://localhost/magento.
Problem:
After successfull installation of the magento store on XAMP I had tried to login to admin panel by visiting http://localhost/magento/admin or http://localhost/magento/index.php/admin. I am no longer login into admin account
In fact in the “Log in to Admin Panel” window whenever you provide wrong password/username combination it displays “Invalid Username or Password.” But whenever you provide correct password it does not show anything.
Reason of the problem:
The problem occurs because magneto could not store cookies. We run it as localhost and localhost is not true domain but to store cookies we need a domain. That’s why login stops without saying any word.
Solutions:
First Solution:
http://localhost/magento/index.php/admin will fail but if you connect as http://127.0.0.1/magento/index.php/admin it will work.
Second Solution:
Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
Find:
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
and replace
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
After this save the file. And try to login into the admin.
Third Solution:
Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
Find below at line 96:
if (isset($cookieParams[‘domain’])) {
$cookieParams[‘domain’] = $cookie->getDomain();
}
Replace the code found in line 96 with this one:
if (isset($cookieParams[‘domain’]) && !in_array(“127.0.0.1”, self::getValidatorData())) {
Clear your browser’s cookies to start with a clean slate then clear the Magento cache by deleting all the contents of the var\cache
Happy Coding!