Give more informations please.
Why Are Non-Admin Users Logged Out After Performing Operations (e.g., Clicking Menu)?
I'm encountering an issue where non-admin users get logged out immediately after performing operations on my web application, such as clicking a menu or triggering other actions. Could someone point me in the right direction on how to troubleshoot this further? Could it be related to session expiration, cookie mismanagement, or something else in my setup?
@EvanArlen194 Ok.
These routes are accessible only for students.
Hmmm ... does the problem occur when a student tries to trigger an action ? Does it occur with all actions for the routes inside the mahasiswa middleware ?
If yes, the problem is probably inside a controller method.
Or perhaps another idea ... where have you declared the alias for your middleware ?
https://laravel.com/docs/11.x/middleware#assigning-middleware-to-routes
Have you tried to assign your middleware to the route like in the documentation ?
Route::middleware(MahasiswaMiddleware::class)->prefix('dashboard/mahasiswa')->group(function () {
...
});
Please or to participate in this conversation.