Magento Fix: Customers can’t log in to version 1.8 1.8.1 & 1.9

by admin

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 Bss Commerce (@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 with a handful of Magento 2 extensions that are willing to help you every time. 

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.