title: How to delete cookies using javascript after certain time
body: <p>I am trying to delete a the value cookie that I created after a certain interval. Lets say after 10 second I want the cookie gone</p>
  
  <pre><code>function fullday()
  {
      document.getElementById("res").innerHTML="1 day";
      document.cookie="day="+1;
      document.cookie.setMaxAge(0);
  }
  </code></pre>
  
  <p>This is the code above. I'm coding in PHP right now and then when I try to destroy cookie from PHP it works fine, however I need to pass the cookie's value in javascript so now im stuck with it and cannot destroy it.</p>