Here is an article described how to share the authentication cookie between the domain and the sub domain: ASP.NET MVC - cross sub domain authentication/membership
What I want is to switch users between domains. For example there are two asp_membership database for the two domains. (The sub domain will run in a virtual directory.) Now if user A1 log in to the main domain then while browsing the sub domain user A1 should be automatically authenticated. Provided users with the same name exists in both the databases.