@piljac1 Just login with remember and it will work.
https://laravel.com/docs/7.x/authentication#remembering-users
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
As some of you may already know, the session is different from subdomains to subdomains and it is also possible to share the same session between all subdomains via the domain session config.
However, I encountered a specific use case today. I need to have two different sessions (frontend domain / admin domain), but I need to be able to programmatically login an authenticated admin domain user to the frontend domain when clicking on a link that redirects to the frontend domain. Both subdomains share the same users table.
I haven't found a simple, clean and straight forward solution to this issue, so I need your expertise on this one !
Thanks in advance,
- Jacob
Could you set the cookie domain to the parent domain? When the back end user logs in, give them a separate cookie which represents them in the backend.
When a user tries to access content for which they must be authenticated, the auth middleware runs.
You could adapt this to see if the user presented this backend cookie. If so, check their id and if ok, log them in.
You will need to ensure you set the app name so that session cookies are not confused.
Also watch mohammed said video regarding multi tenancy because a front end user could change the domain on their session cookie to gain access to the backend
Please or to participate in this conversation.