I setup magento and find the problem { cant login to admin panel on localhost after magento setup )  and find the solutions also :) here is the solution …

- Go to {your_magento_path}/var and remove session and cache directories content.

- Remove your cookies { if you use Firefox try : ctrl + shift + del } then select cookies and clear them, you can use web developer tools also to clear cookie.

- use http://127.0.0.1/magento/index.php/admin

 
then you can go admin->system->Configuration->web 
and update Base URL = http://127.0.0.1/magento/

Try now and check your magento site @ localhost ;)