When i started learning Magento , my first step was installation of magento on my localhost ! I just began installation like WordPress & at that time i didnt aware it was much harder than wordpress installation , specially on localhost using Wamp server ! Sometimes on localhost after fresh magento installation you get the problem to not able to login in admin panel (backend) , whether your username & password are right.
You can solve this problem using following method.
Go to :-
Find the code given below around 77 line :-
// session cookie params $cookieParams = array(</strong> 'lifetime' => $cookie->getLifetime(), 'path' => $cookie->getPath(), 'domain' => $cookie->getConfigDomain(), 'secure' => $cookie->isSecure(), 'httponly' => $cookie->getHttponly() );
Comment above code , Done.
Refresh & try to login again..
The real problem is that when a Magento instance is running through a localhost and tries to create a cookie, but fails to do so because it requires a domain and localhost is not a true domain..
Leave a comment , if it is useful to solve your problem !!