Closed marctaule closed 1 year ago
Have you checked the configuration section on Sanctum docs?
You are likely missing this:
Finally, you should ensure your application's session cookie domain configuration supports any subdomain of your root domain. You may accomplish this by prefixing the domain with a leading
.
within your application'sconfig/session.php
configuration file:'domain' => '.domain.com'
Make sure to include that dot prefix!
So in your case it should be:
'domain' => '.mydomain.com'
You can also do this through an environment variable:
SESSION_DOMAIN=.mydomain.com
Hope this helps.
Hi @amrnn90 ! nice! It works! I was getting crazy :) Thanks you so much!!
Hi! I have a problem and I don't know why it happens. In local everything works fine, but in production I have mydomain.com (frontend) and api.mydomain.com (backend). When I try to login I get 419 ("message": "CSRF token mismatch."). Do you know why? Thanks and good job! :)