I just learned laravel, how to use this session?
This will result in an error
Request::session()->put('user', 'test');
Error content: Session store not set on request.
How to solve this?
PHPz2017-05-16 16:54:20
You should be fine if you update Laravel to 5.2.27 and later versions.
Refer to Laravel5.2.27 to automatically add web middleware to each page
黄舟2017-05-16 16:54:20
The session configuration file is configured in config/session.php
You can check to see if your configuration is wrong
曾经蜡笔没有小新2017-05-16 16:54:20
If you are laravel5.2, when using session status, csrf protection and other functions, you must use the "web" middleware
Route::group(['middleware' => ['web']], function () {
// your routes here
});