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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:41:29  来源:igfitidea点击:

Invalid Form Key. Please refresh the page. on magento admin login page

phpmagentocontent-management-systemmagento-1.9

提问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 链接。问题的详细说明和可能的解决方案。

https://magento.stackexchange.com/questions/98220/security-patch-supee-7405-possible-problems/98236#98236

https://magento.stackexchange.com/questions/98220/security-patch-supee-7405-possible-problems/98236#98236

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

  1. Remove app/code/local/Mage/Core/Model/Session.phpif exist.
  2. remove var/cachedirectory.
  3. Then clear browser cache and cookies.
  1. app/code/local/Mage/Core/Model/Session.php如果存在则删除。
  2. 删除var/cache目录。
  3. 然后清除浏览器缓存和 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