function removeAllCookies() {
  let cookies = document.cookie.split(';');
  let date = new Date();
  date.setTime(date.getTime() - (24 * 60 * 60 * 1000));
  let expires = `expires=${date.toGMTString()}`;
  for (let i = 0; i < cookies.length; i++) {
    let cookie = cookies[i];
    let key = cookie.split('=')[0];
    document.cookie = `${key}=; ${expires}; path=/`;
  }
  document.getElementById('message').innerHTML = 'All cookies cleared.'
}
// Clears all of the key / value pairs
Clears all of the key / value pairs
Clears all of the key / value pairs
function removeAllCookies() {
  let cookies = document.cookie.split(';');
  let date = new Date();
  date.setTime(date.getTime() - (24 * 60 * 60 * 1000));
  let expires = `expires=${date.toGMTString()}`;
  for (let i = 0; i < cookies.length; i++) {
    let cookie = cookies[i];
    let key = cookie.split('=')[0];
    document.cookie = `${key}=; ${expires}; path=/`;
  }
  document.getElementById('message').innerHTML = 'All cookies cleared.'
}
function removeAllCookies ( ) { let cookies = document . cookie . split ( ';' ) ; let date = new Date ( ) ; date . setTime ( date . getTime ( ) - ( 24 * 60 * 60 * 1000 ) ) ; let expires = ` ${ date . toGMTString ( ) } ` ; for ( let i = 0 ; i < cookies . length ; i ++ ) { let cookie = cookies [ i ] ; let key = cookie . split ( '=' ) [ 0 ] ; document . cookie = ` ${ key } ${ expires } ` ; } document . getElementById ( 'message' ) . innerHTML = 'All cookies cleared.' }
Clears all of the key / value pairs
Clears all of the key / value pairs