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

hak's avatar
Level 1

How to authenticate Laravel Cookie based authentication in react hosted in deferent domains

I need some guidance with React. When building a Single Page Application (SPA) using React and Laravel, which authentication method is recommended? Should I use cookie-based session authentication or token-based authentication?

The solution should also support cross-domain . I’ve noticed that Laravel Sanctum’s cookie-based authentication doesn’t work properly across different domains. Given this, would token-based authentication be a better option for web applications? I’d appreciate your suggestions.

0 likes
0 replies

Please or to participate in this conversation.