I am encountering a 410 Page Expired issue on my subdomain while working with a project running in production on primarydomain.com.
My setup includes a subdomain test.primarydomain.com for testing, and everything works fine on the primary domain and locally (thankfully). However, on the subdomain, I am facing this "Page Expired" issue, especially with forms.
On the test server, which is hosted at test.primarydomain.com I have configured the .env file with the following:
SESSION_DRIVER=database
SESSION_DOMAIN=.primarydomain.com or SESSION_DOMAIN=test.primarydomain.com or SESSION_DOMAIN=null
SESSION_LIFETIME=120
In the production domain i.e. primarydomain.com the .env is configured as:
SESSION_DRIVER=database
SESSION_DOMAIN=primarydomain.com
SESSION_LIFETIME=120
Despite these settings, I cannot seem to resolve the issue. The odd part is that if I clear both the browser cache and the project cache (using the artisan command), it randomly allows me to log in once. However, once I log out, the issue reappears, and I get stuck with the "Page Expired" error every time I try to log in again.
To clarify, I have already included the @csrf directive in all forms, and as mentioned, everything works fine on the primary domain and in the local setup, but the problem persists specifically on the subdomain.
Any help on resolving this would be greatly appreciated!