this is the most common problem we face when we install the magento in localhost. This is because of session parameter.
Really simple solution to commenting a single line. Below is the solution
1) go to root/app/code/core/Mage/Core/Model/Session/Abstract/
2) Open the file Varien.php
3) go to line no. 100
4) you will get call_user_func_array(‘session_set_cookie_params’, $cookieParams);
5) Just delete or comment this line.
6) Now you can login into admin.