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
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/