title: Add multiple cookies to clients web browser via HttpListenerResponse
body: <p>I am trying to add multiple cookies to a clients web browser via my response. </p>
  
  <p>First I add multiple cookie objects to the header using the System.Net.HttpListenerResponse.SetCookie method and then send back the response. According to the documentation this method "Adds or updates a Cookie in the collection of cookies sent with this response."</p>
  
  <p>When I look at the cookies in the browsers developer tools I see only a single cookie gets added. My second cookies name and value seem to be getting appended to the value of my first cookie.</p>
  
  <p><img src="https://i.stack.imgur.com/Yr8SX.png" alt="Chrome Developper Tools - Cookies Image"></p>
  
  <p>I wrote a simple console application to demonstrate the behavior all that you would need to do is add "127.0.0.1    website.test.com" to your host file and the URL will resolve.</p>
  
  <pre><code>using System.Net;
  using System.IO;
  
  namespace ConsoleApp1
  {
      class Program
      {
          static void Main(string[] args)
          {
              using (HttpListener listener = new HttpListener())
              {
                  listener.Prefixes.Add(@"http://website.test.com/cookies/");
                  listener.Start();
                  HttpListenerContext context = listener.GetContext(); //Waits for an incoming request
                  HttpListenerRequest request = context.Request;
                  HttpListenerResponse response = context.Response;
                  response.SetCookie(new Cookie("name1", "value1"));
                  response.SetCookie(new Cookie("name2", "value2"));
                  response.StatusCode = (int)HttpStatusCode.OK;
                  Stream responseStream = response.OutputStream;
                  StreamWriter writer = new StreamWriter(responseStream);
                  writer.Write("");
                  response.Close();
              }
          }
      }
  }
  </code></pre>
  
  <p>I also tried adding a semicolon to the end of my values. This corrected the issue with my second cookie being appended to my first cookies value but still only one cookie in the client.</p>