【问题标题】:Laravel Website on local server is showing error (The page has expired due to inactivity. Please refresh and try again. )本地服务器上的 Laravel 网站显示错误(页面因不活动而过期。请刷新并重试。)
【发布时间】:2020-01-26 15:10:00
【问题描述】:

我的网站在托管服务器上运行良好,但是当我下载所有文件并想在本地服务器上进行更改时,提交表单时显示错误。所有表单都有CSRF Token

The page has expired due to inactivity. Please refresh and try again. 

我已经通过以下命令清除了缓存、路由,甚至生成了一个新的密钥。

php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
php artisan generate:key

【问题讨论】:

  • 请检查 POST 请求标头并确保正确传递令牌并确保 .env 文件中的会话生命周期

标签: laravel laravel-5


【解决方案1】:

运行作曲家更新 如果仍然无法正常工作,请导航至引导程序 -> 缓存并删除其中存在的文件。

要测试令牌是否通过在浏览器的检查元素中使用网络选项卡。

【讨论】:

    猜你喜欢
    • 2020-03-27
    • 2018-02-19
    • 2018-09-04
    • 2019-09-06
    • 1970-01-01
    • 2018-03-01
    • 2018-09-16
    • 2019-01-20
    • 1970-01-01
    相关资源
    最近更新 更多