Level 29
Well this is because controller middleware(s) are not terminable. :(
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When i attach the web middleware in my route group as below, the session is created, cookies set and session data is saved to database.
Route::group( [
'https',
'middleware' => ['web'],
], function(){
....
});
However, when I attach the middleware in controller constructor, the session is started, cookies set but the session data is not persisted.
public function __construct()
{
$this->middleware('web');
}
Any one has any clue what going on?
Well this is because controller middleware(s) are not terminable. :(
Please or to participate in this conversation.