Hi Lauren, Unfortunately I do not have test store.
I have this code in form.phtml
formKeyElement.setAttribute('value', '<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>');
getFormKey returns litemagefmkeylmg string.
But when we submit form and try to validate in controller using following method:
protected function _getSession()
{
return Mage::getSingleton('core/session');
}
protected function _validateFormKey()
{
$formKeyFromRequest = $this->getRequest()->getParam('form_key', null);
$formKeyFromSession = $this->_getSession()->getFormKey();
if (!$formKeyFromRequest || $formKeyFromRequest != $formKeyFromSession) {
return false;
}
return true;
}
getFormKey returns valid key like L4Iexn1FiRZWdemB
this validation obviously will be failed...
I am not sure why different output from the same method call.