I've recently run into some really weird problems I'm having a hard time troubleshooting. The errors aren't easily repeatable and not all users are reporting the same things. They started after a recent major template upgrade.
The two main complaints are some users aren't able to login and others aren't being served the mobile version of the template. I've got no idea if the issues are related or what is causing them so I'll just explain all the issues I can recall and maybe you guys can help me piece it together...
I have a user login form on the front-end and most of the time it works. Sometimes it fails without an error, just reloads the page and the user finds themselves still logged out. Repeated attempts to login still won't let the user in. I've found clearing the cookies will get rid of the issue, but asking a user to clear the cookies each time they want to login seems poor.
The user DB is shared with an install of bbPress. As far as I know the issues aren't occurring over there. At one time, months previous, I tried merging the cookies of the two installs (as detailed by a page on the bbPress site, right now the link eludes me) and failed. The user can login on either site, but they've gotta do it on a per site basis. I've got no idea if this somehow messed up the way my install of WP assigns cookies or something, thought I'd mention it.
The other main issue is my mobile site sometimes fails to load. I've built the entire mobile site using the built in conditional is_iphone. The mobile site has been up for months with almost zero complaints. Somehow during the upgrade the functionality has become sketchy, with some users reporting the are repeatedly served the desktop version of the site on their mobile phone. During the relaunch of the new template almost all the edits were exclusively on the desktop site, I barely touched the mobile site and didn't touch any of the conditionals. But somehow the is_phone check is now randomly failing.
I'm almost completely at a loss as to how to troubleshoot these two issues. My phone is loading the mobile site without fail and everything looks perfect. In an attempt to try mobile detection other than the is_phone conditional I tried implementing the old standby detectmobilebrowsers.mobi script and was repeatedly served this error when trying to detect the browser:
Warning: Cannot modify header information - headers already sent by (output started at /home/homeport/public_html/wp-content/themes/sandbox/header.php:5) in /home/homeport/public_html/wp-content/themes/sandbox/mobile_device_detect.php on line 109
I've seen a similar error before in the past (on a different install) but I still don't totally understand exactly what the header is or how/why it is sent and modified. Could there possibly be problems with the header that are affecting the login/cookies and mobile detection?
Does anyone even have a small sniff of an idea where to start here?