Trying to set a domain in the cookie in asp.net and I am very novice in asp.net so wanted to know how this can be done.
here is my code
// Create cookie
var cookieData = new NameValueCollection();
cookieData["first_name"] = first_name;
cookieData["last_name"] = last_name;
var cookie = new CookieHeaderValue("UserInfo", cookieData);
cookie.Expires = DateTimeOffset.Now.AddDays(1);
//cookie.Domain = Request.RequestUri.Host;
cookie.Domain = "example.com";
cookie.Path = "/";
Need to set the cookie to work for srv1.example.com & srv2.example.com
currently running through Visual Studio and using Request.RequestURI.Host gives me the domain as localhost.