title: refresh page once cookie has been set via javascript
body: <p>I have ran into an issue while trying to refresh a page in JavaScript once a cookie has been set. </p>
  
  <p>I basically set a cookie once a check box has been checked. I then refresh the page, and remove the cookie or expire it in my case. But for some reason the page just keeps refreshing. Here is my code:</p>
  
  <pre><code>document.cookie="accept=1";
  var accept = getCookie("accept"); 
  
  if (accept =="1") {
      document.cookie = "accept=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
      window.location.reload();
  }
  </code></pre>
  
  <p>Are there any issues with the above?</p>