>Magento Fix: Customers can’t login to version 1.8 ,1.8.1 and 1.9

Magento Fix: Customers can’t login to version 1.8 ,1.8.1 and 1.9

If you have recently upgraded Magento, and you have a custom template, you will notice that you are unable to login as a customer into the site. 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. I have been fixing numerous sites recently, so I thought I’d share.

Here is the solution:

1 – Go to app/design/frontend/[Your-package]/[Your-theme]/template/customer/form/login.phtml

Find: <ul class=”form-list”>

and paste this right after the code above:

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

See the Pen Bewri by BssCommerce (@bssgroup) on CodePen.

2 – Go to app/design/frontend/Your-package]/[Your-theme]/template/persistent/customer/form/login.phtml and apply the same changes.

I hope this helps. Let’s Like, Share and Subscribe if you find this post useful for you 

If you have any further questions, please contact us to get more explanation. We are certified Magento developers in Web Development and Magento extensions that are willing to help you every time.