I used

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

Code to resolve the issue but not worked. Please help me

  • You updated from version 1.7 to 1.9 ?
    – St3phan
    Nov 8, 2016 at 12:39

3 Answers 3


If you enabled persistent, then you should modify the login.phtml file under persistent template folder

app/design/frontend/[your theme]/default/template/persistent/customer/form/login.phtml

Or if not then adding that should work, then you just need to clear cache if caching is enabled.


Please clear cache "root/var/cache", session in "root/var/session" and reindex in dashboard admin or with shell.


You have to force Magento to use the same cookie domain for both secure and unsecure URLs. You can inspect your sites cookies using the developer tools in the FireFox or chrome browser. This solution was tested on Magento

When the Session Cookie Management variables are not set incorrectly Magento may create two "frontend" cookies with different cookie domains. This typically happens during the login process when you have HTTPS (ie. SSL enabled) for the secure URL. Here are workable values for the Session cookie management configuration.

Cookie Life Time: 3600
Cookie Path: /
Cookie Domain : .mydomain.com (The dot prefix is important)
Use HTTP Only : No
Cookie Restriction Mode: No 
  1. In the admin panel go to System -> Configuration -> Web-> Session Cookie Management
  2. Set the Cookie Management configuration as shown above
  3. Save the configuration and clear the Magento cache
  4. Restart your web server to clear the PHP variables in case you made the change directly in MYSQL database
  5. Clear your browser cache to remove any existing cookies associated with your magento site.

Using the dot prefix on the cookie domain is important to prevent duplicate cookies from being created.

Changing the cookie domain will also affect the "adminhtml" cookie used by the Magento back end. Make sure to clear your browser cache to prevent admin login problems.

  • In my case, not working in chrome only, but all other browser working good. May i know what is the issue?
    – Gem
    Apr 27, 2018 at 7:00
  • I am facing the same issue and tried the above solution but not working for me. Can you please suggest me here? Nov 9, 2021 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.