For those who are struggling with the Magento Admin Panel log in after local installation – don’t give up just yet. I know Magento is quite a pain to install, it simply does not work “out of the box” and requires some server tweaking but that will be the subject for another topic which I plan to publish soon. For now let’s have a look at how we can fix this.
The problem lies in cookies that Magento relies on.
Locate the file varien.php. You can find it here
[magento_install]\app\code\core\Mage\Core\Model\Session\Abstract
[magento_install] is the path to your Magento installation. If you’re using Wamp like me it’d be something like C:\wamp\www\magento
Open the file in your editor and locate the line in the code that says session_set_cookie_params. I am using Magento 1.4.0.1 and this line has number 80 but if you’re using other version of Magento this can be different but not far from there.
Now the easy part. You need to include the block of code that handles cookies in the multiline comment by using /* code here */ like so
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
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();
}
call_user_func_array('session_set_cookie_params', $cookieParams);
if (!empty($sessionName)) {
$this->setSessionName($sessionName);
}
*/
That’s it. Now save the file and log in to the admin panel.
Have fun.

