Today’s Magento installation has become a real drag!! The upgrade to version 1.2.1 was troubling as after the upgrade I had trouble logging into the admin page. After digging for hours trying to find a fix, I finally came up with the right fix!! View Entire Thread Here
The long and short of the fix is that apparently the newer Magento version is implementing some security check to make sure that the domain is a valid one that is accessing the admin page; a valid domain name or host consists of one with a period in the host name, so if you are installing locally using something like http://localhost, YOU WILL RUN INTO THIS PROBLEM! There are a couple ways to fix this
1) you can reference your admin page by using http://127.0.0.1 (this way it has periods in the host name) instead of localhost or
2) if you are on windows xp, add a host record in your hosts file by going to: C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost
3. modify the core Magento code (keep in mind you may have to re-apply the fix if you update the code Magento code) – go to: app/code/core/Mage/Core/Model/Session/Abstract and open up varien.php, and comment out lines 73 (comment out the comma at the end of the line) through 76 so that it looks like the following:
// set session cookie params
$this->getCookie()->getPath() //remove this after putting on server (leave the comma) ,
I am sure many people will appreciate this fix!