When you setup your security provider use the mymaindomain.com in the cookie settings, this way the user will be logged in on the subdomain as well.
When you setup your security provider use the mymaindomain.com in the cookie settings, this way the user will be logged in on the subdomain as well.