So, on to more debugging:
With the setting "Redirect administration pages to original blog's domain" unchecked, we're seeing some funky behavior. I can log in just fine. Kevin, not so much. I threw some debugging code in there. When we hit the page
http:mappedomain.com/?dm_gotoadmin=1
I am sometimes getting nothing (not false or true) from the is_user_logged_in() function.
I can't come up with any rhyme or reason for it. I threw this instead of the redirect_to_admin() function:
function redirect_to_admin() {
if ( isset( $_GET[ 'dm_gotoadmin' ] ) && is_user_logged_in() ) {
wp_redirect( site_url( "wp-admin/" ) );
}
{
echo("<p>This is where it fails</p>");
echo("<p>Is he logged in? " . is_user_logged_in() . "</p>");
echo(site_url("wp-admin/"));
die();
}
}
For me, if that debugging code is there, it consistently hits the else statement. However, if I attempt to log in - hit the page with the ?dm_gotoadmin=1, get the die else statement, then modify the code to take out the else statement and reupload it and refresh the same page (not having done anything else) I get through to the admin page.
It seems like there's some sort of log in how long it takes to recognize that someone is logged in... Is that even possible?