Customer Can't log in only if i register a new user it automatically goes to my account. However if i try to login with a existing user it refreshes the page.

I already tried to insert <?php echo $this->getBlockHtml('formkey'); ?> into the different login.phtml

that didn't work so i tried with <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

right below the tag and that didn't work either.

Any suggestions?

closed as off-topic by Fabian Blechschmidt, benmarks Jul 16 '15 at 18:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Fabian Blechschmidt, benmarks
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I came here after having a similar (same?) issue. After researching the problem a bit further it showed that the session was not loaded due to security reasons preventing the session cookie to be set. You can find the details in Mage_Core_Model_Session_Abstract_Varien It yielded to be a general session login problem. Therefore I strongly suggest to look into solutions relating admin login problems note: question relates older version, resulting in the create-login – Summer-Sky Jan 27 '16 at 21:31

Try to override AccountController

class Web_Customer_AccountController extends Mage_CUstomer_AccountController{
public function loginPostAction()
// generate form_key if missing or invalid
if (!($formKey = $this->getRequest()->getParam('form_key', null)) || $formKey != Mage::getSingleton('core/session')->getFormKey()) {
$this->getRequest()->setParams(array('form_key' =>Mage::getSingleton('core/session')->getFormKey()));

// rest code is same as from Mage/Customer/controllers/AccountController.php

The only right thing to do here is to jump into a xdebug session and trace the problem.

Hacking any core file, as Marius already said, doesn't fix the problem, only hides it.

Are you sure, the form_key is inserted? Are you sure it is submitted? Are you sure, the form key is the abort reason?


After much researching and reading codes, I found that "call_user_func_array" for some reason not working.
Open file
Comment line no : 110 below function
call_user_func_array('session_set_cookie_params', $cookieParams);
If this works then , place the same file in local in same path.
Cheers ;)

  • 1
    This is a wrong answer. You should never edit the core code. Even if the problem does not appear after that, it does not solves it. It just hides it. – Marius Jan 9 '15 at 12:28

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