Since Magento upgrade to 1.8.1 version, customer cannot login.

The bug can be easily fixed by adding a line of code to the login.phtml file of your template to contain form_key for validation.

  • Go to /app/design/frontend/default/YOURTHEME/
    template/
    persistent/customer/form/login.phtml
  • Add the line below in red to the customer login template:

* Make sure the path is YOURTHEME’s path

<ul class=”form-list”>
<li>
<label for=”email” class=”required”><em>*</em><?php echo $this->__(‘Email Address’) ?></label>
<div class=”input-box”>
<input type=”text” name=”login[username]” value=”<?php echo $this->escapeHtml($this->getUsername()) ?>” id=”email” class=”input-text required-entry validate-email” title=”<?php echo $this->__(‘Email Address’) ?>” />
<input type=”hidden” name=”form_key” value=”<? echo Mage::getSingleton(‘core/session’)->getFormKey(); ?>” />
</div>
</li>
<li>
<label for=”pass” class=”required”><em>*</em><?php echo $this->__(‘Password’) ?></label>
<div class=”input-box”>
<input type=”password” name=”login[password]” class=”input-text required-entry validate-password” id=”pass” title=”<?php echo $this->__(‘Password’) ?>” />
</div>
</li>