Magento Admin panel throws error Invalid form key. please refresh the page. This issue happen through number of ways, so I will guide some points to sort out these.
- Completely clear the /var/session and /var/cache folder
- Clear your browser cache and cookies
- Update proper domain value in core_config_data table where path is web/cookie/cookie_domain
- Still your facing the issue, comment below line from app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file line between 87 to 105
// session cookie params
$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']);
}
}
}