We use a subdomain (in.example.com) for website visitors from India and would like to login users into a subdomain and main domain websites simultaneously.
The subdomain version is made via a DNS CNAME record targeting to the same source as the main domain, thus the core content of the website is loaded from the same source as the main website.
The problem arises when users log in on the subdomain version: they are redirected to the main domain, while the login to the subdomain version does not happen. The website is built on Wordpress.
We adjusted the cookie settings to the highest level domain (.example.com) via a
define('COOKIE_DOMAIN', '.example.com');
in wp-config.php to log in users simultaneously in in.example.com and example.com. However, the desired simultaneous login is not happening.
Please help us understand if the approach with the cookies is correct and, if so, where it can be adjusted.