<h2>Şu anki zamandan 7 gün sonrayı kullanmak</h2>
<p id="sonuc"></p>
<script>
  function GunSonra(gun) {
    var bugun = new Date();
    var sonucTarih = new Date(bugun);
    sonucTarih.setDate(bugun.getDate() + gun);
    return sonucTarih;
  }
  document.getElementById("sonuc").innerHTML = GunSonra(7);
  document.cookie = '_Wolkanca=true; expires=' + GunSonra(7) + ';';
</script>
#sonuc {
  color: red;
}
/*
How to get this cookie to expire after x days
*/

External CSS

  1. https://codepen.io/wolkanca/pen/wvgOPWb

External JavaScript

  1. https://codepen.io/wolkanca/pen/wvgOPWb