Here's a simple one: How do you reliably get the base domain
from full domain name or URI? Specifically I've run into this
scenario in a few recent applications when creating the Forms
Auth Cookie in my ASP.NET applications where I explicitly need
to force the domain name to the common base domain. So,,,, all
should return  Here's the code where I need to use this type of
logic for issuing an AuthTicket explicitly:  private void
IssueAuthTicket(UserState userState, bool rememberMe)
FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket(1, userState.UserId,
DateTime.Now, DateTime.Now.AddDays(10),
rememberMe, userState.ToString());      string ticketString =
FormsAuthentication.Encrypt(ticket);     HttpCookie cookie = new
HttpCookie(FormsAuthentication.FormsCookieName, ticketString);
cookie.HttpOnly = true;     if (rememberMe)
cookie.Expires = DateTime.Now.AddDays(10);