DEV Community

Cover image for How to Fix Session store not set on request Laravel 11?
Wahid
Wahid

Posted on

How to Fix Session store not set on request Laravel 11?

Add the following code in the bootstrap/app.php file:

use Illuminate\Session\Middleware\StartSession;
$middleware->append(StartSession::class);
Enter fullscreen mode Exit fullscreen mode

Image description

This is because the way we register custom middleware has changed slightly compared to Laravel 10 and earlier versions.

Hope this helps, thank you!

Top comments (4)

Collapse
 
awinojanett profile image
Janet Awino

Thank you for this

Collapse
 
manuel_cabreravivas_53df profile image
Manuel Cabrera Vivas

thanks

Collapse
 
sanjudilshan554 profile image
K.A.S DILSHAN

Thank you very much

Collapse
 
marshal_nzenza_cd36b3e859 profile image
Marshal Nzenza

This saved my life, thanks so much.