Let\'s say I\'m hosting a website at http://www.foobar.com.
Is there a way I can programmatically ascertain \"http://www.foobar.com/\" in my code behind (i.e. witho
string host = Request.Url.Host; Regex domainReg = new Regex("([^.]+\\.[^.]+)$"); HttpCookie cookie = new HttpCookie(cookieName, "true"); if (domainReg.IsMatch(host)) { cookieDomain = domainReg.Match(host).Groups[1].Value; }