Support the ongoing development of Laravel.io →
posted 2 weeks ago
Laravel

visvanathan liked this thread

1

Which laravel version you are using?

0

You cannot use the session service before the Illuminate\Session\Middleware\StartSession middleware is called. This middleware is by default in the 'web' group and is executed after the global middlewares. In other words, if you want to use session in the global middleware you will have to put the Illuminate\Session\Middleware\StartSession middleware in the global middleware stack and before your custom middleware.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Alexey krosenut Joined 16 Apr 2025

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.