Search code examples
laravelformsmiddlewarelaravel-5.6login-script

The page has expired due to inactivity. Please refresh and try again. LARAVEL 5.6


I need some help. I don't know, what's wrong with my code, yesterday it works fine, but when I'm trying to change the user this is what happened ERROR

and this is my CODE

I've tried to find the solution on the internet but some of them are saying that I didn't use them

{{csrf_field()}}

as you see on my code, I think I had nothing wrong, please help me :')


Solution

  • With Laravel 5.6 using Blades templates, it's pretty easy.

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

    It doesn't work, then Refresh the browser cache and now it might work. (When we update our application, a browser may still use old files. If you don’t clear your cache, Old files can access problems when you apply)

    For more details open link:- CSRF Protection in Laravel 5.6