laravel session storage failedSession store not set on request.
某草草
某草草 2017-05-16 16:52:20
0
3
697

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?

某草草
某草草

reply all(3)
PHPzhong

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

黄舟

The session configuration file is configured in config/session.php
You can check to see if your configuration is wrong

曾经蜡笔没有小新

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
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template