首先在共享托管上访问Laravel应用程序时,CSRF令牌未设置(419页过期)
我将Laravel应用程序部署在共享的托管系统中,并且该应用程序正常工作,但是每次我在新浏览器中首次打开网站时,我将post
我进行返回错误的请求419,页面过期
。之后,该系统正常工作,每个帖子都正确地完成了,但是我不知道为什么第一次在新浏览器中打开系统时,此错误总是会发生。 csrf_token
在代码上是正确的。
<form method="POST">
@csrf
<input class="fields" name="user" placeholder="Email"/><br/>
<input class="fields" name="password" type="password" placeholder="Senha"/><br/>
<input class="entrarbtn" value="Entrar" type="submit"/><br/>
</form>
I deployed my laravel application in a shared hosting system and the application works fine, but every time I open the website for the first time in a new browser the first POST
request that I make returns error 419, page expired
. After that the system works fine, every POST is made correctly but I don't know why always this error happens the first time the system is opened in a new browser. The csrf_token
is correct at the code.
<form method="POST">
@csrf
<input class="fields" name="user" placeholder="Email"/><br/>
<input class="fields" name="password" type="password" placeholder="Senha"/><br/>
<input class="entrarbtn" value="Entrar" type="submit"/><br/>
</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚在php.ini上添加了此设置,立即工作
just added this settings on php.ini and works now