We have a custom login and account creation plugin. It works fine on our live environment (example.com)
but not on our staging environment (test.example.com)
.
When we call wp_insert_user
via an AJAX function, it successfully creates the user and returns their ID. wp_signon
also appears to work. But in both cases, the user doesn't actually get logged in on the staging environment.
After looking through Chrome's developer tools, I realized that the live environment is sending set-cookie: wordpress_logged_in_...
like it's supposed to, but the staging environment is not.
There's nothing in the error log about this, and it happens if we disable all of our other plugins on the staging environment.
What could be the cause of this? How can we make it send the login cookies like it's supposed to?