m4martie's avatar

How to retrieve user

Hello guys, I'm new here, as well as to Laravel, and I am currently developing a system. And I have this difficulty that I don't know how to log in my currently registered user. If you can help, that is a big help for me.

0 likes
17 replies
Cronix's avatar

And I have this difficulty that I don't know how to log in my currently registered user

What do you mean? They can't login via the login form, or you're trying to manually log them in via your own code? Are you using laravels built in auth system? You'll need to provide a little more info.

m4martie's avatar

They can't log in via log in form. Sorry for bad description.

m4martie's avatar

@Cronix They can't log in via log in form. Sorry for bad description. And yes I am using auth form

Cronix's avatar

That typically has something to do with sessions not being generated. If you're using the file driver for sessions (the default setting), keep an eye on /storage/framework/sessions and see if new session files are being generated, and when they are being generated. It could be that that directory doesn't have write permissions for the web server user, so it can't write the session files.

Cronix's avatar

and when you log in, does it change the session data?

Cronix's avatar

So what actually happens when they go to yoursite.com/login, fill in their credentials and they attempt to login? Are there any errors? Is there anything useful in /storage/logs/laravel.log?

m4martie's avatar

@Cronix there's no error at all because I didn't put any routes yet at web.php It just kept redirecting to /login

Cronix's avatar

@m4martie So, you don't even have Auth::routes(); in your /routes/web.php route file?

m4martie's avatar

@Cronix Yes, that's the one I need to figure out on how to use that one.

m4martie's avatar

Thanks guys, I can finally move on my project. It's working now.

Please or to participate in this conversation.