Home > Article > Backend Development > Session keeps reporting error Session store not set on request
Route::group(['middleware' => ['web']], function () { // }); 仍然报错,看了 session是使用默认file,没问题;文件也是可写的,然后在
Kernel.php中添加了
protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, ];
I suddenly reported the following error without doing anything:
RuntimeException:Session store not set on request.
Solution:
Maybe some of your installation components need to be updated, try it:
[php] view plain copy composer update
Try running it again.
If you are using a file session, check whether your storage directory has write permissions. Use database to check if there is a sessions table When using memcache/redis, have you started the memcached and redis services, and have you installed the corresponding extensions
The above is the detailed content of Session keeps reporting error Session store not set on request. For more information, please follow other related articles on the PHP Chinese website!