The issue you're experiencing might be related to the domain/origin mismatch you mentioned. When you're working with subdomains, you need to ensure that your cookies are accessible across all subdomains.
In your config/session.php file, you should set the domain configuration option to your base domain, prefixed with a period. This will make the session cookie available to all subdomains of your base domain.
Here's how you can do it:
'domain' => '.domain.io',
Also, ensure that your SESSION_DOMAIN in your .env file matches the domain specified in your config/session.php file.
SESSION_DOMAIN=.domain.io
Remember to clear your config cache after making these changes by running php artisan config:cache in your terminal.
If this doesn't solve your issue, it might be related to a misconfiguration on your server. Ensure that your server is correctly configured to handle cookies and sessions.
Also, check if there's any difference in the way your local and production environments handle HTTPS, as this can also cause issues with cookies. If your production server is using HTTPS, make sure your SESSION_SECURE_COOKIE is set to true in your .env file.
SESSION_SECURE_COOKIE=true
I hope this helps! Let me know if you have any other questions.