Magento 1.9.2.2 无法在前端创建帐户和登录
Magento 1.9.2.2 cannot create account and login on frontend
我正在使用 Firefox,但我开始遇到问题。我无法在前端的 Magento 1.9.2.2 中创建新用户,也无法使用注册用户登录。在后端,我可以毫无问题地创建用户。
前段时间还没有发生这种情况。
我尝试了这些解决方案但没有奏效:
- 将
<?php echo $this->getBlockHtml('formkey') ?>
添加到我的模板的一些文件中。
- 删除
var/cache
和var/session
。
- 更改 cookie 的生命周期。
- 更改cookie的域名。
有什么想法吗? :(
如果您在应用补丁 SUPEE-6788 或升级到 Magento 1.9.2.2 或更高版本后无法创建客户或登录,这可能是由于缺少表单键造成的。
确保将表单键添加到您的所有(自定义)模板文件中:
在app/design/frontend/[package]/[theme]/template/customer/form/register.phtml
和app/design/frontend/[package]/[theme]/template/persistent/customer/form/register.phtml
添加
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
之后
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
我正在使用 Firefox,但我开始遇到问题。我无法在前端的 Magento 1.9.2.2 中创建新用户,也无法使用注册用户登录。在后端,我可以毫无问题地创建用户。
前段时间还没有发生这种情况。
我尝试了这些解决方案但没有奏效:
- 将
<?php echo $this->getBlockHtml('formkey') ?>
添加到我的模板的一些文件中。 - 删除
var/cache
和var/session
。 - 更改 cookie 的生命周期。
- 更改cookie的域名。
有什么想法吗? :(
如果您在应用补丁 SUPEE-6788 或升级到 Magento 1.9.2.2 或更高版本后无法创建客户或登录,这可能是由于缺少表单键造成的。
确保将表单键添加到您的所有(自定义)模板文件中:
在app/design/frontend/[package]/[theme]/template/customer/form/register.phtml
和app/design/frontend/[package]/[theme]/template/persistent/customer/form/register.phtml
添加
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
之后
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />