title: How do I create a cookie client side using blazor
body: <p>I have a login page that goes off to the server gets a bunch of data, then I want to take some of that data and save it into a cookie using Blazor on the client.</p>
  
  <p>So To start I have successfully injected IHttpContextAccessor. and for now in my Blazor function I have:</p>
  
  <p><code>httpContextAccessor.HttpContext.Response.Cookies.Append("test", "ddd");</code></p>
  
  <p>in debug when I hit the above line of code it errors with:</p>
  
  <blockquote>
    <p>"Headers are read-only, response has already started."</p>
  </blockquote>
  
  <p>Of course I will not be saving "test" with "ddd" in the cookie, I'm just trying to get a cookie to save at the moment.</p>