test cookie validation

PHOTO EMBED

Tue Feb 14 2023 21:44:06 GMT+0000 (Coordinated Universal Time)

Saved by @markporo #test #cookie

window.location.search.includes('cro_mode=qa')

// or

window.location.search.indexOf('cro_mode=qa') > -1

// finding it in cookies: 
function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}
//then...
getCookie('cro_mode')

//or something like ...
  const parts = document.cookie.split('cro_mode');
  if (parts.length === 2) {console.log(parts.pop().split(';').shift())}
content_copyCOPY