bastiaan89's avatar

AuthenticateSession middleware

In the development branch of the laravel/laravel repository, I noticed that the AuthenticateSession middleware is added to the web stack (commented out). I've tried to understand what it's supposed to do, but the only thing I discovered is that the "remember me" checkbox no longer works when this middleware is enabled (done by ticking the checkbox, logging in, deleting the session cookie, and refreshing). Is that its intended purpose?

0 likes
7 replies
mkarnicki's avatar

@kfirba I've shared your article on my Twitter, @mkarnicki . Thank you.

PS HAH I also updated my username here to match that of Twitter.

Nael.Saeed's avatar

Hi, I know this is a late reply but I just happened to pass by and wanted to share this and see what you think about it

I tried to move these lines

\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,

from $middlewareGroups => $middleware in App/Http/kernal.php

and auth()->user() worked fine in the constructor. Is there any down side for moving these lines as stated above?

Please or to participate in this conversation.