ASPx set Cookie Domain
<p>I have a code as follows:</p>

<pre><code> this.Response.Cookies.Add(new HttpCookie("COOKIENAME",'test'));
</code></pre>

<p>I want to add the domain ".test.com" for this cookie. How do I do so? I tried the standard:</p>

<pre><code>    this.Response.Cookies["COOKIENAME"].Domain = ".test.co.uk";
</code></pre>

<p>But the cookie is not being set for the whole domain. Any suggestions?</p>

<p>The following is not working either:</p>

<pre><code>HttpCookie MyCookie = new HttpCookie("COOKIENAME");
        MyCookie.Value = 'test';
        MyCookie.Domain = ".test.co.uk";

        this.Response.Cookies.Add(MyCookie);
</code></pre>
