# Implementation review

**URL:** <https://community.auth0.com/t/implementation-review/66161>\
**Category:** Get Help\
**Tags:** auth0-php, php\
**Created:** [July 14, 2021, 3:01pm UTC](https://community.auth0.com/t/implementation-review/66161 "2021-07-14T15:01:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stanley](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@stanley](https://community.auth0.com/u/stanley)\
**Post date:** [July 14, 2021, 3:01pm UTC](https://community.auth0.com/t/implementation-review/66161/1 "2021-07-14T15:01:28Z")

</div>

Please include the following information in your post:

- **Which SDK this is regarding:** auth0-php
- **SDK Version:** 7.9.1
- **Platform Version:** PHP 8
- **Code Snippets/Error Messages/Supporting Details/Screenshots:**

> <https://gist.github.com/bkilshaw/38366183c9be5d716bea54bf5b161e65>

Hi all,

I’m using Auth0 in my Laravel application. To date I’ve been using the auth0-laravel package which has worked alright, but there are some unresolved errors that I haven’t been able to troubleshoot. I also haven’t been a fan of the implementation, mostly because it was worked into an existing application. When a user logs in, Auth0 passes me back an EmployeeID which I have in a database. All I really need to do is try and look up that user and if they exist log them in, and if they don’t then authentication failed.

I’ve gone ahead and made a branch that directly uses the auth0-php SDK instead of auth0-laravel. It’s working, but, I’m just looking to get some extra eyes on it to make sure I’m not blatantly missing anything and that there aren’t any security concerns with my implementation.

Hope that’s alright, thanks!

---

<div class="post-metadata">

**Author:** ![stanley](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@stanley](https://community.auth0.com/u/stanley)\
**Post date:** [July 15, 2021, 4:59pm UTC](https://community.auth0.com/t/implementation-review/66161/2 "2021-07-15T16:59:27Z")

</div>

Bumping this one back up, hoping to get some input, thanks!

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [July 15, 2021, 9:10pm UTC](https://community.auth0.com/t/implementation-review/66161/3 "2021-07-15T21:10:03Z")

</div>

Hey @stanley 👋 Good stuff, I think this looks solid! Offhand, I don’t see any issues, and it looks like all the essentials are covered. Please let us know how this works out for you in your application!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 16, 2021, 6:37am UTC](https://community.auth0.com/t/implementation-review/66161/4 "2021-07-16T06:37:41Z")

</div>

Thanks Evan for helping on this one!

---

<div class="post-metadata">

**Author:** ![stanley](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@stanley](https://community.auth0.com/u/stanley)\
**Post date:** [July 16, 2021, 4:01pm UTC](https://community.auth0.com/t/implementation-review/66161/5 "2021-07-16T16:01:28Z")

</div>

Thanks @evansims

One thing I’m curious about and I can’t quite figure out; is it necessary to call `$auth0->logout()` to log the user out? When someone logs out of our application we want to make sure they’re forced to log back in again since the application is used from shared devices. I wasn’t sure if calling `auth()->logout()` and redirecting to the logout URL was sufficient, or if I should be calling `$auth0->logout()` as well.

Thanks!

---

<div class="post-metadata">

**Author:** ![evansims](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evansims/32/27011_2.png) [@evansims](https://community.auth0.com/u/evansims)\
**Post date:** [July 16, 2021, 6:04pm UTC](https://community.auth0.com/t/implementation-review/66161/6 "2021-07-16T18:04:37Z")

</div>

Hey @stanley 👋 In this case I think you’ll want to do as you have proposed; each call will handle a different aspect of clearing out the user session. $auth0-\>logout() will call [this portion of the SDK code](https://github.com/auth0/auth0-PHP/blob/7.x/src/Auth0.php#L820) which handles clearing out the local session state, and redirecting to the logout endpoint ensures the session is cleared on Auth0’s end.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2021, 8:37am UTC](https://community.auth0.com/t/implementation-review/66161/7 "2021-07-29T08:37:26Z")

</div>


