Session keeps reporting error Session store not set on request

PHP中文网
Release: 2023-03-20 10:42:01
Original
4604 people have browsed it
Route::group(['middleware' => ['web']], function () {
    //
});
仍然报错,看了 session是使用默认file,没问题;文件也是可写的,然后在
Copy after login
Kernel.php中添加了
Copy after login
protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    \Illuminate\Session\Middleware\StartSession::class,
    \Illuminate\View\Middleware\ShareErrorsFromSession::class,
];
Copy after login

I suddenly reported the following error without doing anything:

RuntimeException:Session store not set on request.
Copy after login

Solution:

Maybe some of your installation components need to be updated, try it:

[php] view plain copy
composer update
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template