setting cookie.domain in asp.net
<p>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.</p>

<p>here is my code</p>

<pre><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 = "/";
</code></pre>

<p>Need to set the cookie to work for srv1.example.com &amp; srv2.example.com </p>

<p>currently running through Visual Basic and using Request.RequestURI.Host gives me the domain as localhost.</p>
