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

GTHell's avatar

Is Laravel auth method is just a php session?

Is it a session based authentication?

0 likes
4 replies
Cronix's avatar

Yes, just like the majority, if not all, php sites with login functionality. "Auth method" isn't "just a php session". It's a class with different functionality that stores/retrieves data from session. It's too simplistic to say "auth method just a php session". Auth also deals with forms, validation, loading the user from the database, etc.

1 like
GTHell's avatar

@Cronix No intention to simplify it. It's complicate pattern, though.

Do you know the authentication method uses by Facebook or Google? Is it also session based since Facebook is PHP.

Cronix's avatar
Cronix
Best Answer
Level 67

Basically, yes. It's more than just "php" sites though. It's basically all websites. The web itself is stateless (the http protocol doesn't have any state to it). To work with sessions, you need a cookie so the site can track your session. If you go to any of these sites with a login, you'll notice it will create a cookie, which usually stores the session id.

1 like
GTHell's avatar

@Cronix Alright cool. So, basically is JWT & Session is the prefer method this day? I thought there're alternative to session/cookie being use by big tech like Facebook.

Please or to participate in this conversation.