laravel - Laravel 419 页面在表单提交时过期
问题描述
在 Laravel 8 中,我得到一个 419 | 每当我尝试提交表单时出现页面过期错误。我确保使用 Blade Directive @csrf 包含 CSRF 令牌。为了调试简单,我将表单简化为:
<form id="form-contact" name="form-contact" class="contact-form" method="POST">
@csrf
<div class="row">
<div class="col-sm-6 animated">
<div class="input-text form-group">
<input type="text" name="name" id="name" class="input-name form-control" placeholder="Full Name*" />
</div>
</div>
</div>
<button class="btn btn-sm active" type="submit">Submit</button>
</form>
而且我仍然收到 419 页面过期错误。
在我的 .env 文件中:
SESSION_DRIVER=file
SESSION_LIFETIME=120
在命令行上,如果我检查我的会话文件夹权限:
ls -ld storage/framework/sessions
我得到:
drwxrwsr-x 2 apache www 12288 Oct 1 15:32 storage/framework/sessions
这些权限对于会话目录是否正确,还是我需要更改权限?
我还需要做些什么来解决这个 419 问题吗?
解决方案
推荐阅读
- forgerock - 在 Forgerock AM(Web 代理流程)中进行身份验证后获取“无法从 HttpRequest 创建 SSOToken(SessionID 为空)”
- lumen - 如何在 swagger-php 流明中添加多维数组?
- python - 使用 SQLAlchemy 在 mysql 中像 PostgreSQL array_agg 这样的聚合?
- c# - ASP.NET 表单 - 安装 Microsoft.Owin.Host.SystemWeb 时模块正在卸载
- python - Python / Selenium - 访问非交互式元素
- r - 从硬币包中的对象 QuadTypeIndependenceTest 和 ScalarIndependenceTest 中提取 p 值
- python-3.x - 使用脚本中定义的函数在 ipython shell 中设置全局变量
- python - 使用 or-tools 的不同车辆类型的 VRP
- php - 使用用户代理在 Laravel 后端设置条件以在满足条件时隐藏/显示 AdSense
- gitlab - Gitlab CI/CD 检测文件修改选择阶段