0

In my store login and register just keep on refreshing i have add the following lines in every register.phtml after form tag

<?php echo $this->getBlockHtml('formkey'); ?> 

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

but still not working !

configuration/general/web/cookie settings:

Hhtp only :no, Cookie restriction :no, Time :86400.

added these lines in login.phtml but still just refreshing

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

added theses lines in accountController.php in login post action but still issue exists the same

* Login post action
 */
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()
    ));
}
    if ($this->_getSession()->isLoggedIn()) {
        $this->_redirect('*/*/');
        return;
    }

1 Answer 1

0

You have to just add this code <?php echo $this->getBlockHtml('formkey'); ?> right after a <form> tag OR the second one but not both.

EDIT:

For your loop problem:

1) the <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" /> you add it right after <ul class="form-list">

2) Update this query in your database: update core_config_data set value = null where path = 'web/cookie/cookie_domain'

3) change in database: table: core_config_data, update web/url/redirect_to_base to 0 instead of 1

4) clean your Magento and navigator cache and session

10
  • :o thanks. i ll do that but login loop? it just keep on refreshing :(
    – kind
    Commented Jun 3, 2017 at 20:47
  • check your code for errors, try to clean cache magento and navigator
    – PЯINCƎ
    Commented Jun 3, 2017 at 20:58
  • i have done what u have suggested still both in loop refresh
    – kind
    Commented Jun 3, 2017 at 20:59
  • registeration started working... login.phtml already have formkey and i m adding this <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" /> right after <ul class="form-list"> but login refresh is still the same
    – kind
    Commented Jun 3, 2017 at 21:07
  • please look my edit
    – PЯINCƎ
    Commented Jun 3, 2017 at 21:09

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.