Sha256: 2944193729cac06750e85d3af273a1b7b6dcb34598a4715a68a6aedf9e99003f

Contents?: true

Size: 670 Bytes

Versions: 2

Compression:

Stored size: 670 Bytes

Contents

function setCookie(name, value, exdays) {
  const now = new Date();
  now.setTime(now.getTime() + (exdays * 24 * 60 * 60 * 1000));
  let expires = "expires="+ now.toUTCString();
  document.cookie = name + "=" + value + ";" + expires + ";path=/";
}

function getCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
      var c = ca[i];
      while (c.charAt(0)==' ') c = c.substring(1,c.length);
      if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function eraseCookie(name) {   
  document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-ham-1.0.2 assets/cookies.js
jekyll-ham-1.0.1 assets/cookies.js