Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Inkognitoo's avatar

Every time a new session.

If i don't use guest middleware then every request generate me new session on server (cookies don't come in my browser). But if i use guest middleware, cookie returned, but app redirect me on root page. (i don't want it)

How i use sessions without guest middleware?

0 likes
3 replies
thomaskim's avatar

@Inkognitoo Don't use the web middleware for the latest version of Laravel. Lol. It's applied by default. Check your app/Providers/RouteServiceProvider.php file, and see if you have the mapWebRoutes function. In it, the web middleware should be automatically applied to your routes.

Please or to participate in this conversation.