Cross domain Security Provider - Login/Register

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.