Sharing cookie between two sites
From Logic Wiki
If they are in different domains
It's impossible to write a cookie from one domain and read it from other one.
So my approach was to create a cookie on one site and call the other site with a parameter in background.
On the other site we can create a cookie with that parameter.
If they are in same domain but in different sub domains
in c# we create them as it is
var userCookie = new HttpCookie("UserCookie");
userCookie.Values.Add("username", firstName);
userCookie.Values.Add("signouturl", HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + OpteviaPortal.Navigation.GetUrlForSiteMarker("Account - Logout"));
userCookie.Domain = ConfigurationManager.AppSettings["CookieDomain"];
userCookie.Path = "/";
Response.Cookies.Add(userCookie);
we don't add expiry to destroy cookie when browser window closed