P
P
php_raper2019-01-07 01:20:56
Laravel
php_raper, 2019-01-07 01:20:56

The page has expired due to inactivity. Sending a Post Request?

I'm just starting to develop on laravel
when processing POST this page comes out
The page has expired due to inactivity.
Please refresh and try again.
tried these solutions, did not help
https://www.5balloons.info/fixed-page-e … laravel-5/
version 5.6

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Bedoyar, 2019-01-08
@PulpiRZVK

Does this error occur on any POST requests? Or only when the page has not been updated for a long time?

A
Alexander Gamov, 2019-01-10
@slowdream

csrf don't forget to send

E
ExenJer, 2019-01-11
@ExenJer

Insert the @csrf directive in your POST request form

<form action="/" method="POST">
@csrf

<!–– HTML code ––>
</form>

If you send from another place, then you can get the csrf token using the csrf_token() helper function.
Laravel CSRF middleware requires the _token HTTP parameter or the X-CSRF-TOKEN HTTP header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question