Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 419页在提交表格时过期_Laravel_Csrf_Laravel 8 - Fatal编程技术网

Laravel 419页在提交表格时过期

Laravel 419页在提交表格时过期,laravel,csrf,laravel-8,Laravel,Csrf,Laravel 8,在Laravel8中,每当我尝试提交表单时,就会出现419页过期错误。我确保使用Blade指令@CSRF包含CSRF令牌。为了简化调试,我将表单简化为: <form id="form-contact" name="form-contact" class="contact-form" method="POST"> @csrf <div class="row">

在Laravel8中,每当我尝试提交表单时,就会出现419页过期错误。我确保使用Blade指令@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>
在命令行上,如果我检查会话文件夹权限:

ls -ld storage/framework/sessions
我得到:

drwxrwsr-x 2 apache www 12288 Oct  1 15:32 storage/framework/sessions
会话目录的这些权限是否正确,或者我是否需要更改权限


要解决这个419问题,我还需要做什么吗?

尝试清除缓存-php artisan缓存:Clear我尝试了,但没有成功。您正在向当前路线提交帖子。请求是否到达控制器方法,或者在到达控制器方法之前使用419失败?在到达控制器方法之前使用419失败。我没有使用jQuery提交表单,只是使用常规HTML表单提交。没有JavaScript。
drwxrwsr-x 2 apache www 12288 Oct  1 15:32 storage/framework/sessions