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

后端 未结 17 3201
你的背包
你的背包 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 06:09

    try this one in your global handler app/Exceptions/Handler.php

    public function render($request, Exception $e)
    {
        if ($e instanceof \Illuminate\Session\TokenMismatchException) {
    
            return redirect('/login');
    
        }
    
        return parent::render($request, $e);
    }
    

提交回复
热议问题