Laravel 5.5 login and register page says:The page has expired due to inactivity.[TokenMismatchException]

后端 未结 17 3194
你的背包
你的背包 2020-12-09 05:11

I just created a new project of laravel version 5.5 with the laravel installer.And run the command \"php artisan make:auth\".The views and controller are generated

相关标签:
17条回答
  • 2020-12-09 05:57

    if you created a new project localhost You need view config/session line : 166 if 'secure' => true , you need edit 'secure' => false, When you up the host or server, re-config => true sorry i know a little english , hope can help you

    0 讨论(0)
  • 2020-12-09 05:58

    I had this same issue. vagrant reload --provision worked for me

    0 讨论(0)
  • 2020-12-09 05:59

    Had this issue as well! Solved it by:

    1. Clearing browser session storage and cookies.
    2. Running php artisan cache:clear
    3. Ensuring the storage/framework/sessions folder was empty, except for the .gitignore.
    4. Restarting dev environment.
    0 讨论(0)
  • 2020-12-09 06:00

    I would also keep csrf_token in a meta tag.

    <meta name="csrf-token" content="{{ csrf_token() }}">
    
    0 讨论(0)
  • 2020-12-09 06:02

    In my case, I've got the same error message and then figured that I missed to add csrf_token

    {{ csrf_field() }}
    

    Or without form helper that will be,

    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    

    If that doesn't work, then-

    Refresh the browser cache and hopefully it will work, thanks.

    0 讨论(0)
  • 2020-12-09 06:02

    Add this code in your

    app\Exceptions\Handler.php file

    if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
        // Perform operation on page expired
    }
    
    0 讨论(0)
提交回复
热议问题