One of the most frustrating situations in Magento upgrade, redesign and customer switch is the fact that everything always must go as planned. Developers know to always expect the unexpected, but to better prepare here is one situation where customers get furious and for developers it is always hard to catch what is really going on.
We are talking about the situation when everything in the store is functioning properly after upgrade, however owners of the business starts calling and says his customers can not log in. The blame automatically falls on the developer (which in most cases is), but before you start checking your code, there are two instances where you will find solution in almost 90% of the cases.
First instance is to check for the form key. If you are upgrading from Magento 1.4, 1.5, 1.6 to latest version of Magento 1.9.2, chances are this will happen to you. Even higher probability if you are using some custom theme and files are not properly assigned. So first start with this solution.
When your new theme does not supply variable form)key your sessions are nullified and you customer can not log in. To fix that look for all of your login.phtml files and include this code:
<input type=”hidden” name=”form_key” value=”<?php echo Mage::getSingleton(‘core/session’)->getFormKey(); ?>” />
(usually just below <ul class=”form-list”>)
Make sure you check all instances of your login.phtml. They are found in several places like template/customer/form or /persistent/customer/form folders.
If first method does not solve it, there is another situation where you need to make sure you have your session in your local folder. This is very important if you are using your custom theme. If you are also switching between ssl and non-ssl for login, this is most likely the answer. So let’s do this in Magento.
Copy the file Session.php from app/code/core/Mage/Customer/Model to app/code/local/Mage/Customer/Model.
Open the newly copied file and comment out this area:
public function setCustomerAsLoggedIn($customer)
Please make sure you clean all of your browser cookies and sessions before testing. If you are on varnish cache, also make sure that is empty as well before trying.