php 无效的表单密钥。请刷新页面。在 magento 管理员登录页面上
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36074754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Invalid Form Key. Please refresh the page. on magento admin login page
提问by rodge
I have a weird situation again that I have encounter on magento. Few hours ago, I successfully logged in to admin dashboard. After I logged out and restart my pc and tried to log in again. I got an error
我又遇到了一个奇怪的情况,我在 magento 上遇到过。几个小时前,我成功登录到管理仪表板。在我注销并重新启动我的电脑并尝试再次登录后。我有一个错误
Invalid Form Key. Please refresh the page.
无效的表单密钥。请刷新页面。
Magento was installed in a live server. I didn't change anything or add something on the database. Credentials are valid but we cannot log in. Also, I cannot loggin to the magento downloader panel.
Magento 安装在实时服务器中。我没有更改任何内容或在数据库中添加任何内容。凭据有效,但我们无法登录。此外,我无法登录到 magento 下载器面板。
What kind of bug is this?
这是什么bug?
How can we solve this?
我们如何解决这个问题?
UPDATE!
更新!
From @DouglasRadburn link. The detailed explanation of the problem and the possible solutions.
来自@DouglasRadburn 链接。问题的详细说明和可能的解决方案。
Also similar to @Makwana Ketan answer
也类似于@Makwana Ketan 的回答
回答by stalinrajindian
I am sure that problems came from session storage & cookie setting.
我确信问题来自会话存储和 cookie 设置。
You should follow below:
你应该遵循以下:
DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain';
DELETE FROM core_config_data WHERE path='web/cookie/cookie_path';
Delete all directories from below folders:
删除以下文件夹中的所有目录:
/var/session
/var/cache
回答by Ashraf CK
While working on localhost can not sign in or create Account - ubuntu OS
在本地主机上工作时无法登录或创建帐户 - ubuntu OS
Invalid Form Key. Please refresh the page.
无效的表单密钥。请刷新页面。
invalid key error solve
无效键错误解决
change this value in your php.ini file
在 php.ini 文件中更改此值
max_input_time : 3600 max_input_vars : 200000 memory_limit : 2G
max_input_time : 3600 max_input_vars : 200000 memory_limit : 2G
then go to your MySQL database
然后转到您的 MySQL 数据库
find core_config_data table
找到 core_config_data 表
change base URL localhost to 127.0.0.1
将基本 URL localhost 更改为 127.0.0.1
than searchpath Like %...% domain then Go
比搜索路径像 %...% 域然后转到
changevalue localhostto 127.0.0.1in front of web/cookie/cookie_domain( path )
在web/cookie/cookie_domain( path )前面将值localhost更改为127.0.0.1
Go to your magento root directory then app -> /etc/ -> env.php open this file change value localhost to 127.0.0.1 ( 2 places in file )
转到您的 magento 根目录,然后 app -> /etc/ -> env.php 打开此文件,将值 localhost 更改为 127.0.0.1(文件中的 2 个位置)
go to browser press ctrl+shift+deletethen check cache || cookie click on clear data
转到浏览器按ctrl+ shift+delete然后检查缓存 || cookie 点击清除数据
then run all command with sudo on magento root directory
然后在 magento 根目录上使用 sudo 运行所有命令
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
回答by Makwana Ketan
- Remove
app/code/local/Mage/Core/Model/Session.php
if exist. - remove
var/cache
directory. - Then clear browser cache and cookies.
app/code/local/Mage/Core/Model/Session.php
如果存在则删除。- 删除
var/cache
目录。 - 然后清除浏览器缓存和 cookie。
Hope this helps you!
希望这对你有帮助!
回答by Avik Roy
Please ask hosting provider to increase php_value max_input_vars 75000
.
请要求主机提供商增加 php_value max_input_vars 75000
。