How can I have cookies working for multiple domains at once?
You can't with usual means. A cookie it meant for a domain (even sub-domains), but not multiple domains. The alternative for getting it work with multiple domains, is extremely twisted.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey guys,
I am trying to run multiple domains on a single Laravel application, lets say my domains are:
mysite.com mysite.io
I am having trouble allowing users to login on both sites. In config/session.php I have to set a domain for the session cookies. If I set domain to mysite.com then users on mysite.io get a TokenMismatchException.
How can I have cookies working for multiple domains at once?
Thanks
Please or to participate in this conversation.