M
M
Morfeey2019-03-20 17:17:09
CSRF
Morfeey, 2019-03-20 17:17:09

What could be the reason for the 419 error (page expired) when sending a post request?

We have the usual form, with a token and a POST request. In response, I get 419 | Page expired.
I rummaged through the whole Google, tried everything I could, everywhere, in principle, the same thing. The project is new, I am writing from scratch for the first time, maybe I forgot something in the initial settings? What other data is needed to help debug?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin B., 2019-03-20
@Kostik_1993

419 error says that the CSRF token sent by the form is outdated, missing or incorrect
I think it's worth digging into whether the token is being passed, and also see what you have as a session driver

M
MiyRon, 2021-05-05
@MiyRon

You need to issue a CSRF token. This is a defense against csrf attacks. Use the @csrf directive inside
your html form, you can read more here https://laravel.com/docs/8.x/csrf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question