I have a WordPress Network setup with subdomains and am having trouble with the logins. I thought at first it was an issue with a custom plugin I'm developing, but the problem persists even after disabling it (and all plugins, custom themes).
I have the WP login form on a site page (site3.example.com/testing) - users need to be logged in to access the testing page. They can log in through wp-admin, but I don't want them accessing the admin so they're redirected to the testing page anyways. The issue is, after submitting the signup form they're simply sent back to the same page not logged in. No error message are created and I've verified the login credential are correct.
I think the issue stems originally from my plugin. It uses user credentials all from site2.example.com - the idea was to keep all the plugin content in one WP site and extend a restricted portion to site3. To get the logins to work this way, I set define('COOKIE_DOMAIN', false);
in wp-config.php - is that advisable? Now even with the plugin disabled, the cookie or history is possibly conflicting with the login?
Also of note; My main site is on primary.ezample.com and my sub sites are site2.ezmaple.com etc. Not the default {subdomain}.{primary domain} structure. This is because my example.come site is not in WordPress so WP needed to not override it. (I did this by manually updating the wp_blogs links in the database - works well enough unless it's the probable cause of this bizarre issue)
Logins for admins and other roles work fine on each other WP Network site, just not the trainers since they are redirected to site3.
Interestingly, everything works fine in a clear history, empty cache browser. Ctrl+F5 hard refresh doesn't do it, it needs to be an entirely new browser session. Naturally, not all of my users want to do that, so I'm looking for possible ways to program a fix in the site itself.