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
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.
If you cannot log in, here is what I would do:
I'm recommending number 3 as you've mentioned modifying core code (never really a good idea)
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...
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/
In fact there is no programming and set up issues for this problem.
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();
}
Just open another browser and open the local magento page with 127.0.0.1 instead of localhost.