4 years ago

file-based sessions not working if "web" middleware assigned in Controller constructor

Posted 4 years ago by felixdeimling

I found out that sessions work if i register the routes and the middleware within a group

Route::group(['middleware' => ['web']], function () {
     Route::get('aktuell', "SeitenController@getAktuell");
     # other routes ...

But not if i assign the middleware in the Controllers constructor

function __construct()

(which is my preffered way..)

works though by saving session explicitly via


Please sign in or create an account to participate in this conversation.