Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sbboke.com/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php:409) in /www/wwwroot/sbboke.com/wp-content/themes/pacify/content-single.php on line 5

Magento 2:管理员登录错误–您的当前会话已过期

–我重新安装了Magento 2.2.5。
–在安装时,我禁用了第三方模块的安装。
–安装成功。
–前端打开正常。
–后端打开正常。
–但是,当我尝试使用正确的用户名和密码登录到后端管理员时,出现以下错误:

Your current session has been expired.

原因:

这是因为在数据库表core_config_data中缺少“ 会话生存期 ” 条目。

您可以登录到Magento2数据库,并在core_config_data表中检查路径admin / security / session_lifetime

或者,您也可以使用以下命令通过命令行检查配置设置值:

php bin/magento config:show admin/security/session_lifetime
If there is an entry with the path admin/security/session_lifetime in the core_config_data table then the output will be the value of that path.

If there is no any entry with the path admin/security/session_lifetime in the core_config_data table then the output will be the following error message:

Configuration for path: "admin/security/session_lifetime" doesn't exist

解:

我在core_config_data表中添加了“ 会话生存期 ”条目,然后从终端刷新了Magento缓存,然后我能够登录到admin。

您要做的是,在Magento2数据库的core_config_data表中添加路径admin / security / session_lifetime,其值为86400

INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`)
VALUES ('default', 0, 'admin/security/session_lifetime', '86400');

或者,您也可以通过命令行直接设置/更新配置设置值:

	
php bin/magento config:set admin/security/session_lifetime 86400

刷新Magento缓存

–打开终端
–转到magento安装根目录

	
cd /path/to/your/magento/folder

–运行命令以刷新缓存

php bin/magento cache:clean

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论