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

ngaunje's avatar

Authentication Success but Redirect kills the session laravel 5.4

When am using my custom login controller the Auth::attemp() work fine but the redirection to intended page kill the session am redirected back to login page. Little help here I'm stack

0 likes
2 replies
Dunsti's avatar
Dunsti
Best Answer
Level 6

Check the following:

  • Do you have cookies enabled in your browser?
  • Do you use the web-middleware on your routes?
robrogers3's avatar

Does your custom auth module depend on the User model. If not you're swimming upstream. I had a problem with a ldap auth but didn't want to store the users. The solution I came up with is a NullUser so I didn't need to persist the login info. It seemed kludgy at the time but if you look at all the guard code it looks to the User in the session.

1 like

Please or to participate in this conversation.