piljac1
2 months ago
385
8
Laravel

Programmatically login on subdomain without sharing the session

Posted 2 months ago by piljac1

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

Please sign in or create an account to participate in this conversation.