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

misadjalovic@gmail.com's avatar

Laravel Angular cross domain session

Hi,

I have the following problem. We have Laravel application with web and API. Also, we have one part of application on another domain and it works with the API.

Angular application is a wizard where users so stuff, we use API for the calls, and when they complete the wizard, they click on a button and they are redirected to the Laravel web.

Crazy part is that we have users and guests, two guards, users working with session since they are redirected after login in the Laravel. Guest uses auth API and tokens.

Problem is how to set session for the guest with the API guard. So that we know who they are after are redirected from Angular to Laravel web.

I have been considering sessions for this, but is it doable? Basically, I guests do stuff on the angular app, Laravel API sets session data during the calls to the API endpoints, and when they are redirected to the Laravel application, session is there and we can auth the user.

Thanks for any kind of help.

0 likes
0 replies

Please or to participate in this conversation.