Multisite Custom Domain Mapping htaccess

Hi,

We are launching a multisite solution. Some of subsite will use their own custom domains.

So out domains will look like this:
1) https://www.mainsite.com
2) https://www.mainsite.com/subsiteA
3) https://www.subsiteB.com

In our solution anyone registers on any of the subsite will automatically get an account with the main site.

in this case, is it possible to let the user stay in the network. So that when a user goes from the main site to https://www.subsiteB.com or vice versa, he will not be logged out.

Is it possible? if so, what should we do with the htaccess? (wordpress.org has default htaccess for subdomain. We are not using a subdomain but custom domain.)

Thanks a lot.

Jing