title: Java Script Cookie expire date
body: <p>how do I get the cookie to expire in 6 month with this code:</p>
  <pre><code>&lt;script&gt;
  var optOutLink = document.getElementById(&quot;opt-out-button&quot;);
    
  if(optOutLink) {
      optOutLink.onclick = function() {
          document.cookie = 'opt-out=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
          return false;
      }
  }
  &lt;/script&gt;
  </code></pre>
  <p>Everytime I try a solution the code stops working.</p>
  <p>thanks</p>