Following an upgrade to magento 1.8.1 on our development servers , we noticed that customers are unable to login to their account.

The issue is raising because the custom login form does not contain any form_key and there is a form key validation happening in loginPostAction of magento.

Here is the solution:

1 – Go to template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and under

<ul class="form-list">

add the following code in the login form

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />


<?php echo $this->getBlockHtml('formkey') ?>

If you are using the login form in different templates then you use add the form_key to the other parts as well.

NOTE: This issue also exists while updating the qty of cart items and new customer registration, the same solution applies there as well.