找到原因后,在SetAuthCookie方法加上几句
HttpCookie cookie = HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName];
cookie.Domain = ".Domain.Ext";
HttpContext.Current.Response.Cookies.Add(cookie);
这下可以不同二级域名可以共用Cookie了,可是后来又发现一个问题,点注销没有反应!!
那再对SignOut做点手脚
System.Web.Security.FormsAuthentication.SignOut();
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,"");
cookie.Expires = new DateTime(1999,10,12);
cookie.Domain = Util.UrlHelper.GetDomain();
cookie.Path = FormsAuthentication.FormsCookiePath;
cookie.Secure = FormsAuthentication.RequireSSL;
Response.Cookies.Add(cookie);
Response.Redirect(Config.CurrentBlog(Context).FullyQualifiedUrl);