michaell
michaell
FFilament
Created by michaell on 2/27/2024 in #❓┊help
Disabling sessions in frontend prevents logging in to FilamentPHP backend?
I'm using FilamentPHP for my admin backend. I don't need sessions in my (non-admin) frontend. Since I don't need them, I don't want them — GDPR and all that. I commented out these three lines from the web middleware group:

// \Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\View\Middleware\ShareErrorsFromSession::class,
// \App\Http\Middleware\VerifyCsrfToken::class,

// \Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\View\Middleware\ShareErrorsFromSession::class,
// \App\Http\Middleware\VerifyCsrfToken::class,
and now the FilamentPHP login window loops. In other words, I enter my credentials and end up back on the login page. There's no error message. That was unexpected because the admin panel seems to have its own middleware group, and that group already uses the same middleware:
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
What am I missing?
7 replies