Laravel/Ui: My user is being logged in for a very short time only. The session does not seem to persist after a redirect.
So I am using laravel/ui for my LoginController. Once a successful login attempt has been made, the method 'authenticated' (which I added to override the method from laravel/ui ) should fire and it does: If I dump Auth::check() in there, it dumps 'true' the moment after I click 'Login' on my login screen.
But then it redirects me to another one of my urls, which is of course intended, but then the user is suddenly not logged in anymore, as Auth::check() now returns 'false'.
I made some attempts to solve it, based on other threads:
-
I have tried to wrap my routes in the 'web' middleware, but that doesn't make the session persist.
-
I have tried setting SESSION_DRIVER in my .env file to 'cookie', but that also didn't change anything.
-
I have changed the name of the session cookie to something else than 'laravel_session', but again no effect.
If anyone has an idea or suggestion on what is going on here, that would be greatly appreciated!
Edit: These are my routes: https://i.imgur.com/2uHPz72.png
Please or to participate in this conversation.